179 | {/* Toggle Command */}
180 |
{
183 | try {
184 | const result =
185 | await window.electronAPI.toggleMainWindow()
186 | if (!result.success) {
187 | console.error(
188 | "Failed to toggle window:",
189 | result.error
190 | )
191 | showToast(
192 | "Error",
193 | "Failed to toggle window",
194 | "error"
195 | )
196 | }
197 | } catch (error) {
198 | console.error("Error toggling window:", error)
199 | showToast(
200 | "Error",
201 | "Failed to toggle window",
202 | "error"
203 | )
204 | }
205 | }}
206 | >
207 |
208 |
Toggle Window
209 |
210 |
211 | {COMMAND_KEY}
212 |
213 |
214 | B
215 |
216 |
217 |
218 |
219 | Show or hide this window.
220 |
221 |
222 |
223 | {/* Screenshot Command */}
224 |
{
227 | try {
228 | const result =
229 | await window.electronAPI.triggerScreenshot()
230 | if (!result.success) {
231 | console.error(
232 | "Failed to take screenshot:",
233 | result.error
234 | )
235 | showToast(
236 | "Error",
237 | "Failed to take screenshot",
238 | "error"
239 | )
240 | }
241 | } catch (error) {
242 | console.error("Error taking screenshot:", error)
243 | showToast(
244 | "Error",
245 | "Failed to take screenshot",
246 | "error"
247 | )
248 | }
249 | }}
250 | >
251 |
252 |
Take Screenshot
253 |
254 |
255 | {COMMAND_KEY}
256 |
257 |
258 | H
259 |
260 |
261 |
262 |
263 | Take a screenshot of the problem description.
264 |
265 |
266 |
267 | {/* Solve Command */}
268 |
0
271 | ? ""
272 | : "opacity-50 cursor-not-allowed"
273 | }`}
274 | onClick={async () => {
275 | if (screenshotCount === 0) return
276 |
277 | try {
278 | const result =
279 | await window.electronAPI.triggerProcessScreenshots()
280 | if (!result.success) {
281 | console.error(
282 | "Failed to process screenshots:",
283 | result.error
284 | )
285 | showToast(
286 | "Error",
287 | "Failed to process screenshots",
288 | "error"
289 | )
290 | }
291 | } catch (error) {
292 | console.error(
293 | "Error processing screenshots:",
294 | error
295 | )
296 | showToast(
297 | "Error",
298 | "Failed to process screenshots",
299 | "error"
300 | )
301 | }
302 | }}
303 | >
304 |
305 |
Solve
306 |
307 |
308 | {COMMAND_KEY}
309 |
310 |
311 | ↵
312 |
313 |
314 |
315 |
316 | {screenshotCount > 0
317 | ? "Generate a solution based on the current problem."
318 | : "Take a screenshot first to generate a solution."}
319 |
320 |
321 |
322 |
323 | {/* Separator and Log Out */}
324 |
325 |
329 |
330 | {/* Credits Display */}
331 |
332 |
333 | Credits Remaining
334 | {credits} / 50
335 |
336 |
337 | Refill at{" "}
338 |
341 | window.electronAPI.openSettingsPortal()
342 | }
343 | >
344 | www.interviewcoder.co/settings
345 |
346 |
347 |
348 |
349 |
353 |
354 |
364 |
365 |
366 |
367 |
368 |
369 | Log Out
370 |
371 |