frontend/app/components/repas/day-navigation.tsx
Nathan Lamy 052e59f1ac
All checks were successful
Deploy to Netlify / Deploy to Netlify (push) Successful in 1m54s
feat: add menus (repas)
2025-08-24 00:34:09 +02:00

41 lines
1.1 KiB
TypeScript

import { ChevronLeft, ChevronRight } from "lucide-react";
import { Button } from "../ui/button";
import type { DateTime } from "luxon";
import DatePickerWithRange from "./date-picker";
export default function DayNavigation({
startDate,
setStartDate,
}: {
startDate: DateTime;
setStartDate: (date: DateTime) => void;
}) {
const handlePreviousDay = () => {
const previousDay = startDate.minus({ days: 1 });
setStartDate(previousDay);
};
const handleNextDay = () => {
const nextDay = startDate.plus({ days: 1 });
setStartDate(nextDay);
};
return (
<div className="mb-2">
<div className="flex flex-row items-center justify-between gap-2">
<Button variant="outline" size="sm" onClick={handlePreviousDay}>
<ChevronLeft className="h-10 w-10" />
</Button>
<div className="flex-1">
<DatePickerWithRange
startDate={startDate}
setStartDate={setStartDate}
/>
</div>
<Button variant="outline" size="sm" onClick={handleNextDay}>
<ChevronRight className="h-10 w-10" />
</Button>
</div>
</div>
);
}