import { Card, LineChart, Title } from "@tremor/react"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc"; import { useFilterContext } from "../context/provider"; import { valueFormatter } from "../lib/valueFormatter"; export const BookingStatusLineChart = () => { const { t } = useLocale(); const { filter } = useFilterContext(); const { selectedTeamId, selectedTimeView = "week", dateRange, selectedEventTypeId } = filter; const [startDate, endDate] = dateRange; if (!startDate || !endDate) return null; const { data: eventsTimeLine, isSuccess } = trpc.viewer.insights.eventsTimeline.useQuery({ timeView: selectedTimeView, startDate: startDate.toISOString(), endDate: endDate.toISOString(), teamId: selectedTeamId || -1, eventTypeId: selectedEventTypeId ?? undefined, }); if (!isSuccess) return null; return ( {t("event_trends")} ); };