mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
21 lines
417 B
TypeScript
21 lines
417 B
TypeScript
'use client';
|
|
import { useTeam, useTeamContext } from 'components/hooks';
|
|
import { Loading } from 'react-basics';
|
|
import notFound from 'app/not-found';
|
|
|
|
export function Team({ children }) {
|
|
const { teamId } = useTeamContext();
|
|
const { data: team, isLoading } = useTeam(teamId);
|
|
|
|
if (isLoading) {
|
|
return <Loading />;
|
|
}
|
|
|
|
if (!team) {
|
|
return notFound();
|
|
}
|
|
|
|
return children;
|
|
}
|
|
|
|
export default Team;
|