import { useState } from 'react' function OptionsPanel({ fileType, options, setOptions }) { const [showAdvanced, setShowAdvanced] = useState(false) const updateOption = (key, value) => { setOptions(prev => ({ ...prev, [key]: value })) } return (

Processing Options

{/* Model Selection */}
{/* Alpha Matting (Image only) */} {fileType === 'image' && ( <>
{options.alphaMatting && (
updateOption('alphaMattingForegroundThreshold', parseInt(e.target.value))} className="w-full px-3 py-2 border border-gray-300 rounded-lg" min="0" max="255" />
updateOption('alphaMattingBackgroundThreshold', parseInt(e.target.value))} className="w-full px-3 py-2 border border-gray-300 rounded-lg" min="0" max="255" />
updateOption('alphaMattingErodeStructureSize', parseInt(e.target.value))} className="w-full px-3 py-2 border border-gray-300 rounded-lg" min="1" />
updateOption('alphaMattingBaseSize', parseInt(e.target.value))} className="w-full px-3 py-2 border border-gray-300 rounded-lg" min="100" />
)} )} {/* Video Options */} {fileType === 'video' && (
updateOption('fr', e.target.value ? parseFloat(e.target.value) : null)} className="w-full px-3 py-2 border border-gray-300 rounded-lg" placeholder="Optional" step="0.1" />
updateOption('fl', e.target.value ? parseFloat(e.target.value) : null)} className="w-full px-3 py-2 border border-gray-300 rounded-lg" placeholder="Optional" step="0.1" />
)} {/* Background Options */}
updateOption('backgroundColor', e.target.value)} className="w-full px-3 py-2 border border-gray-300 rounded-lg" placeholder="#FFFFFF or leave empty for transparent" />
{ const bgFile = e.target.files[0] if (bgFile) { updateOption('backgroundImage', bgFile) } }} className="w-full px-3 py-2 border border-gray-300 rounded-lg" /> {options.backgroundImage && (

Selected: {options.backgroundImage.name}

)}
) } export default OptionsPanel