Move dashboard to client components. (#26)

* Move to client components

* Move to client components

* Fix create team
This commit is contained in:
KM Koushik
2024-06-02 11:03:50 +10:00
committed by GitHub
parent f183905c9f
commit 4a37c66865
10 changed files with 297 additions and 178 deletions

View File

@@ -0,0 +1,23 @@
"use client";
import { FullScreenLoading } from "~/components/FullScreenLoading";
import CreateTeam from "~/components/team/CreateTeam";
import { api } from "~/trpc/react";
export const DashboardProvider = ({
children,
}: {
children: React.ReactNode;
}) => {
const { data: teams, status } = api.team.getTeams.useQuery();
if (status === "pending") {
return <FullScreenLoading />;
}
if (!teams || teams.length === 0) {
return <CreateTeam />;
}
return <>{children}</>;
};