"use client"; import { FC } from "react"; import { Bill, BillingLocation } from "../lib/db-types"; import { deleteLocationById } from "../lib/actions/locationActions"; import { useFormState } from "react-dom"; import { Main } from "./Main"; import { gotoHome } from "../lib/actions/navigationActions"; import { deleteBillById } from "../lib/actions/billActions"; export interface BillDeleteFormProps { bill: Bill, location: BillingLocation } export const BillDeleteForm:FC = ({ bill, location }) => { const handleAction = deleteBillById.bind(null, location._id, bill._id, location.yearMonth.year); const [ state, dispatch ] = useFormState(handleAction, null); const handleCancel = () => { gotoHome(`/?year=${location.yearMonth.year}`); }; return(

Please confirm deletion of bill “{bill.name}” at “{location.name}”.

) }