{/* Block Type Badge */}
{selectedBlock.type === 'text' ? (
) : (
)}
{selectedBlock.type === 'text' ? m.add_text_block() : m.add_image_block()}
ID: {selectedBlock.id.slice(0, 6)}
{/* Text specific fields */}
{selectedBlock.type === 'text' && (
handleUpdateBlock(selectedBlock.id, { text: e.target.value })
}
className="text-xs h-8"
/>
)}
{/* Image specific fields */}
{selectedBlock.type === 'image' && (
{(selectedBlock as WatermarkBlockImage).imageAssetKey && (
)}
handleImageFileChange(e, selectedBlock.id)}
/>
fileInputRef.current?.click()}
className="relative aspect-square w-full rounded-xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 hover:border-primary/50 hover:bg-muted/40 transition-all p-2"
>
{isUploadingImage && (
)}
{localImagePreviews[selectedBlock.id] ||
(selectedBlock as WatermarkBlockImage).imageAssetUrl ? (
<>
{m.upload_image()}
>
) : (
{m.upload_watermark_image()}
{m.upload_watermark_image_hint()}
)}
)}
{/* Size Control (fraction 0..1 of canvas width, shown as %) */}
{/* Color Control for Text */}
{selectedBlock.type === 'text' && (
{(selectedBlock as WatermarkBlockText).color}
handleUpdateBlock(selectedBlock.id, { color: e.target.value })
}
className="w-8 h-8 rounded border border-border cursor-pointer bg-transparent p-0"
/>
handleUpdateBlock(selectedBlock.id, { color: e.target.value })
}
className="flex-1 h-8 text-xs font-mono"
/>
{[
'#FFFFFF',
'#000000',
'#999999',
'#EF4444',
'#3B82F6',
'#10B981',
'#F59E0B',
].map((hex) => (
)}
{/* Opacity Control */}
{Math.round(selectedBlock.opacity * 100)}%
handleUpdateBlock(selectedBlock.id, { opacity: val })
}
/>
{/* Rotation Control */}
{selectedBlock.rotation}°
handleUpdateBlock(selectedBlock.id, { rotation: val })
}
/>
{[-45, -30, 0, 30, 45].map((deg) => (
))}
{/* Position X Control */}
{Math.round(selectedBlock.x * 100)}%
handleUpdateBlock(selectedBlock.id, { x: val })}
/>
{/* Position Y Control */}
{Math.round(selectedBlock.y * 100)}%
handleUpdateBlock(selectedBlock.id, { y: val })}
/>
) : (