import { getBorrowableItems } from "../utils/fetchData"; import { useAtom } from "jotai"; import { startDate, endDate } from "../States/Atoms"; import Cookies from "js-cookie"; export const AddLoan = () => { const [start, setStart] = useAtom(startDate); const [end, setEnd] = useAtom(endDate); return (

1. Zeitraum wählen

{ e.preventDefault(); const form = e.currentTarget as HTMLFormElement; const fd = new FormData(form); const start = (fd.get("startDate") as string) || ""; const end = (fd.get("endDate") as string) || ""; setStart(start); setEnd(end); Cookies.set("startDate", start); Cookies.set("endDate", end); getBorrowableItems(); }} >
); };