stats table
This commit is contained in:
25
src/app/routes/_authed/stats.tsx
Normal file
25
src/app/routes/_authed/stats.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { playerQueries, useAllPlayerStats } from "@/features/players/queries";
|
||||
import { ensureServerQueryData } from "@/lib/tanstack-query/utils/ensure";
|
||||
import PlayerStatsTable from "@/features/players/components/player-stats-table";
|
||||
|
||||
export const Route = createFileRoute("/_authed/stats")({
|
||||
component: Stats,
|
||||
beforeLoad: async ({ context }) => {
|
||||
const queryClient = context.queryClient;
|
||||
await ensureServerQueryData(queryClient, playerQueries.allStats());
|
||||
},
|
||||
loader: () => ({
|
||||
withPadding: true,
|
||||
fullWidth: true,
|
||||
header: {
|
||||
title: "Player Stats"
|
||||
}
|
||||
}),
|
||||
});
|
||||
|
||||
function Stats() {
|
||||
const { data: playerStats } = useAllPlayerStats();
|
||||
|
||||
return <PlayerStatsTable playerStats={playerStats} />;
|
||||
}
|
||||
Reference in New Issue
Block a user