// screens-projects.jsx function NewProjectModal({ onClose, onCreated }) { const [name, setName] = React.useState(''); const [saving, setSaving] = React.useState(false); const [err, setErr] = React.useState(null); const create = () => { if (!name.trim()) { setErr('Name is required'); return; } setSaving(true); setErr(null); window.ZAMPP_API.fetch('/projects', { method: 'POST', body: JSON.stringify({ name: name.trim() }) }) .then(p => { onCreated(p); onClose(); }) .catch(e => { setSaving(false); setErr(e.message || 'Failed to create project'); }); }; return (