Files
cal.diy/packages/features/insights/components/HighestRatedMembersTable.tsx
T
Eunjae Lee 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

41 lines
1.0 KiB
TypeScript

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