"use client"; import { FC } from "react"; import { Bill, BillingLocation } from "../lib/db-types"; 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, location.yearMonth.month); const [ state, dispatch ] = useFormState(handleAction, null); const handleCancel = () => { gotoHome(location.yearMonth); }; return(

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

) }