| 43 | if (!isOpen) return null; |
| 44 | |
| 45 | const handleCompile = async () => { |
| 46 | if (validationError) { |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | setIsCompiling(true); |
| 51 | setResult(null); |
| 52 | |
| 53 | try { |
| 54 | const compileResult = await compiler.compile(options, context); |
| 55 | setResult(compileResult); |
| 56 | } catch (error) { |
| 57 | setResult({ |
| 58 | success: false, |
| 59 | message: `${t('compileDialog.compileFailed')}: ${error}`, |
| 60 | errors: [String(error)] |
| 61 | }); |
| 62 | } finally { |
| 63 | setIsCompiling(false); |
| 64 | } |
| 65 | }; |
| 66 | |
| 67 | return ( |
| 68 | <div className="compile-dialog-overlay"> |