// screen-add.jsx — Add new idea slide-over drawer const { useState: useAddState } = React; function AddIdeaDrawer({ open, onClose, onSubmit }) { const Icon = window.Icon; const [title, setTitle] = useAddState(''); const [cat, setCat] = useAddState(''); const [catOpen, setCatOpen] = useAddState(false); const [desc, setDesc] = useAddState(''); const [tags, setTags] = useAddState([]); const [tagInput, setTagInput] = useAddState(''); const [imgs, setImgs] = useAddState([]); const reset = () => { setTitle(''); setCat(''); setDesc(''); setTags([]); setTagInput(''); setImgs([]); }; const close = () => { onClose(); }; const addTag = (e) => { if (e.key === 'Enter' && tagInput.trim() && tags.length < 5) { e.preventDefault(); setTags([...tags, tagInput.trim()]); setTagInput(''); } }; const valid = title.trim() && cat && desc.trim() && tags.length > 0; const submit = () => { if (!valid) return; onSubmit({ title, cat }); reset(); }; return (
Add new idea
Share something worth building.
setTitle(e.target.value)} placeholder="Enter your idea's general title" className="fld" />
{catOpen && (
{window.CATEGORIES.map(c => ( ))}
)}