()
| 271 | |
| 272 | // Function to handle image generation |
| 273 | const handleGenerateImage = async () => { |
| 274 | try { |
| 275 | setIsLoading(true); |
| 276 | |
| 277 | if (!report) { |
| 278 | throw new Error("No report data available"); |
| 279 | } |
| 280 | |
| 281 | await generateReportImage(report, selectedPreset, presets); |
| 282 | } catch (err) { |
| 283 | console.error("Error generating image:", err); |
| 284 | setError(err instanceof Error ? err.message : "Failed to generate image"); |
| 285 | } finally { |
| 286 | setIsLoading(false); |
| 287 | } |
| 288 | }; |
| 289 | |
| 290 | if (isLoading && !report) { |
| 291 | return <ReportLoading />; |
nothing calls this directly
no test coverage detected