import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; import { Paper, Stack, Text } from "@mantine/core"; import type { IOverviewTrendPoint } from "@/types/overview"; import { overviewChartColors } from "./overview.styles"; function formatDateLabel(date: string) { const parsed = new Date(`${date}T00:00:00`); return parsed.toLocaleDateString(undefined, { month: "short", day: "numeric" }); } export function OverviewBookingTrendChart({ data }: { data: IOverviewTrendPoint[] }) { const hasData = data.some((point) => point.count > 0); return ( Booking trend {!hasData ? ( No bookings in this period ) : ( formatDateLabel(String(value))} formatter={(value) => [value, "Bookings"]} /> )} ); }