import { Bar, BarChart, CartesianGrid, Cell, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; import { Paper, Stack, Text } from "@mantine/core"; import { BOOKING_LIST_TABS } from "@/features/bookings/booking-status.config"; import type { IOverviewPipelineCount } from "@/types/overview"; import { overviewChartColors } from "./overview.styles"; function getPipelineLabel(stage: string) { return BOOKING_LIST_TABS.find((tab) => tab.key === stage)?.label ?? stage; } export function OverviewStatusChart({ data }: { data: IOverviewPipelineCount[] }) { const chartData = data.map((item) => ({ ...item, label: getPipelineLabel(item.stage), })); const hasData = chartData.some((item) => item.count > 0); return ( Pipeline by stage {!hasData ? ( No bookings in pipeline ) : ( [value, "Bookings"]} /> {chartData.map((entry, index) => ( ))} )} ); }