Files
calendar/packages/features/insights/components/RecentFeedbackTable.tsx
T
Eunjae LeeandGitHub 1878802213 fix: update styles of charts on /insights (#22557)
* fix: update styles of charts on /insights

* clean up

* clean up

* share the same styles with ChartCardItem

* margin for event trends

* fix type error
2025-07-17 14:42:35 +00:00

39 lines
951 B
TypeScript

import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc";
import { useInsightsParameters } from "../hooks/useInsightsParameters";
import { ChartCard } from "./ChartCard";
import { FeedbackTable } from "./FeedbackTable";
import { LoadingInsight } from "./LoadingInsights";
export const RecentFeedbackTable = () => {
const { t } = useLocale();
const { isAll, teamId, startDate, endDate, eventTypeId } = useInsightsParameters();
const { data, isSuccess, isPending } = trpc.viewer.insights.recentRatings.useQuery(
{
startDate,
endDate,
teamId,
eventTypeId,
isAll,
},
{
staleTime: 30000,
trpc: {
context: { skipBatch: true },
},
}
);
if (isPending) return <LoadingInsight />;
if (!isSuccess || !data) return null;
return (
<ChartCard title={t("recent_ratings")}>
<FeedbackTable data={data} />
</ChartCard>
);
};