import { useState } from 'react' import { Alert } from '@/components/ui/Alert' import { Button } from '@/components/ui/Button' import { Modal } from '@/components/ui/Modal' import { errorMessage } from '@/lib/api' import { formatQuantity, useDeleteSeedLot, type SeedLot } from '@/lib/seedLots' /** * Retire a lot. Worth confirming because it's the one place cost and germination * data lives — and worth saying plainly that the plantings survive it, since * "will this wipe my garden" is the reasonable fear. */ export function DeleteSeedLotModal({ lot, onClose }: { lot: SeedLot; onClose: () => void }) { const del = useDeleteSeedLot() const [error, setError] = useState(null) return (

{formatQuantity(lot.quantity)} {lot.unit} {lot.vendor ? ` from ${lot.vendor}` : ''} {lot.packedForYear != null ? `, packed for ${lot.packedForYear}` : ''}.

Anything planted from it stays exactly where it is — it just stops being attributed to this purchase.

{error && {error}}
) }