import { Button, Container, MenuItem, Stack, TextField, Typography } from '@mui/material'; import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { v4 as uuidv4 } from 'uuid'; import { useAreas } from '../hooks/dataHooks'; import { useDatabase } from '../context/DBProvider'; export const StartPickListScreen = () => { const areas = useAreas(); const db = useDatabase(); const navigate = useNavigate(); const [areaId, setAreaId] = useState(''); const [notes, setNotes] = useState(''); const start = async () => { if (!areaId) return; const pickListId = uuidv4(); await db.pickLists.add({ id: pickListId, area_id: areaId, created_at: Date.now(), notes: notes.trim() || undefined, }); navigate(`/pick-lists/${pickListId}`); }; return ( Create Pick List Pick lists are reusable. Create one for each store area and update it anytime you restock. setAreaId(event.target.value)} > {areas.map((area) => ( {area.name} ))} setNotes(event.target.value)} multiline minRows={2} /> ); };