// Registration Settings Component const RegistrationSettings = ({ settings, onChange, disabled }) => { const { useState } = React; const providers = useProviders(); const [isGenerating, setIsGenerating] = useState(false); const generateContact = async (field) => { setIsGenerating(true); try { const response = await fetch('/samples/random-contact'); const data = await response.json(); if (response.ok && data.status === 'success') { if (field === 'phone') { onChange({ ...settings, phone_number: data.phone_number }); } else if (field === 'email') { onChange({ ...settings, email: data.email }); } } } catch (error) { console.error('Error generating contact:', error); } finally { setIsGenerating(false); } }; return (
onChange({ ...settings, phone_number: e.target.value })} disabled={disabled} className="flex-1 px-3 py-2 bg-white border border-slate-300 rounded-lg text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-brand-500" />
onChange({ ...settings, email: e.target.value })} disabled={disabled} className="flex-1 px-3 py-2 bg-white border border-slate-300 rounded-lg text-sm transition-colors focus:outline-none focus:ring-2 focus:ring-brand-500 focus:border-brand-500" />
); }; window.RegistrationSettings = RegistrationSettings;