"use client"; import { FC } from "react"; import { BillingLocation } from "../lib/db-types"; import { deleteLocationById } from "../lib/actions/locationActions"; import { useFormState } from "react-dom"; import { Main } from "./Main"; import { gotoUrl } from "../lib/actions/navigationActions"; export interface LocationDeleteFormProps { /** location which should be deleted */ location: BillingLocation } export const LocationDeleteForm:FC = ({ location }) => { const handleAction = deleteLocationById.bind(null, location._id, location.yearMonth); const [ state, dispatch ] = useFormState(handleAction, null); const handleCancel = () => { gotoUrl(`/location/${location._id}/edit/`); }; return(

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

) }