fix: rework sessions

This commit is contained in:
David Nguyen
2025-02-17 22:46:36 +11:00
parent 1ed1cb0773
commit 5fc724b247
57 changed files with 1512 additions and 1446 deletions

View File

@ -1,14 +1,16 @@
import { createContext, useContext } from 'react';
import React from 'react';
import type { TGetTeamByUrlResponse } from '@documenso/lib/server-only/team/get-team';
import type { TGetTeamsResponse } from '@documenso/lib/server-only/team/get-teams';
type TeamProviderValue = TGetTeamsResponse[0];
interface TeamProviderProps {
children: React.ReactNode;
team: TGetTeamByUrlResponse;
team: TeamProviderValue;
}
const TeamContext = createContext<TGetTeamByUrlResponse | null>(null);
const TeamContext = createContext<TeamProviderValue | null>(null);
export const useCurrentTeam = () => {
const context = useContext(TeamContext);