"use client"; import React from 'react'; import { X, Wand2, Loader2, Sparkles, Lock } from 'lucide-react'; import { cn } from '@/lib/utils'; interface EditPromptModalProps { isOpen: boolean; onClose: () => void; image: { data: string; prompt: string } | null; onGenerate: (prompt: string, options: { keepSubject: boolean; keepScene: boolean; keepStyle: boolean }) => Promise; } export function EditPromptModal({ isOpen, onClose, image, onGenerate }: EditPromptModalProps) { const [prompt, setPrompt] = React.useState(''); const [loading, setLoading] = React.useState(false); const [keepSubject, setKeepSubject] = React.useState(true); const [keepScene, setKeepScene] = React.useState(true); const [keepStyle, setKeepStyle] = React.useState(true); React.useEffect(() => { if (isOpen && image) { setPrompt(image.prompt); } }, [isOpen, image]); if (!isOpen) return null; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); try { await onGenerate(prompt, { keepSubject, keepScene, keepStyle }); onClose(); } catch (err) { console.error(err); } finally { setLoading(false); } }; const ConsistencyToggle = ({ label, checked, onChange, color }: { label: string; checked: boolean; onChange: (v: boolean) => void; color: string; }) => ( ); return (
{/* Modal Container */}
{/* Close Button */} {/* Header with Gradient */}

Remix Image

Generate a variation with consistent elements

{/* Content */}
{/* Image Preview & Input Row */}
{/* Image Preview */}
{image && ( <> Source
Reference
)}
{/* Prompt Input */}