{/* PreviewCard */}
{/* Floating edit and delete buttons (only if not editing and isEditable) */}
{isEditable && !editing && (
)}
{/* Only show edit bar when editing */}
{isEditable && editing && (
<>
{/* EditBar */}
setInputUrl(e.target.value)}
disabled={loading}
onKeyDown={e => { if (e.key === 'Enter') handleSaveEdit(); }}
className="flex-1 border border-gray-200 rounded-md px-2.5 py-1.5 text-sm font-sans focus:outline-none focus:border-gray-400"
/>
{/* Button toggle and label input */}
{showButton && (
{
setButtonLabel(e.target.value);
updateAttributes({ buttonLabel: e.target.value });
}}
placeholder="Button label"
className="border border-gray-200 rounded-md px-2 py-1 text-sm font-sans focus:outline-none focus:border-gray-400"
style={{ minWidth: 100 }}
/>
)}
>
)}
{error &&
{error}
}
{/* Only show preview card when not editing */}
{hasPreview && !editing && (
<>
{previewData.og_image && (
)}
{previewData.favicon && (

)}
{previewData.url}
{showButton && previewData.url && (
{buttonLabel || 'Visit Site'}
)}
>
)}
{isEditable && !editing && (
{/* AlignmentBar */}
Align:
{ALIGNMENTS.map(opt => (
))}
)}