setIsHovering(true)}
onPointerLeave={() => setIsHovering(false)}
>
{/* Error Display */}
{shape.props.error && (
⚠️
{shape.props.error}
)}
{/* Image Display */}
{shape.props.imageUrl && !shape.props.isLoading && (

{
console.error("❌ ImageGen: Failed to load image:", shape.props.imageUrl)
this.editor.updateShape
({
id: shape.id,
type: "ImageGen",
props: {
error: "Failed to load generated image",
imageUrl: null
},
})
}}
/>
)}
{/* Loading State */}
{shape.props.isLoading && (
)}
{/* Empty State */}
{!shape.props.imageUrl && !shape.props.isLoading && (
Generated image will appear here
)}
{/* Input Section */}
{
this.editor.updateShape({
id: shape.id,
type: "ImageGen",
props: { prompt: e.target.value },
})
}}
onKeyDown={(e) => {
e.stopPropagation()
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault()
if (shape.props.prompt.trim() && !shape.props.isLoading) {
handleGenerate()
}
}
}}
onPointerDown={(e) => {
e.stopPropagation()
}}
onClick={(e) => {
e.stopPropagation()
}}
disabled={shape.props.isLoading}
/>
{/* Add CSS for spinner animation */}
)
}
override indicator(shape: IImageGen) {
return (