Use context hooks.

This commit is contained in:
Mike Cao 2025-08-21 03:15:47 -07:00
parent 00adb00d2d
commit 600a3d28c3
13 changed files with 46 additions and 44 deletions

View file

@ -8,9 +8,7 @@ import {
useToast,
} from '@umami/react-zen';
import { getRandomChars } from '@/lib/crypto';
import { useContext } from 'react';
import { useApi, useMessages, useModified } from '@/components/hooks';
import { TeamContext } from '@/app/(main)/teams/TeamProvider';
import { useApi, useMessages, useModified, useTeam } from '@/components/hooks';
const generateId = () => `team_${getRandomChars(16)}`;
@ -23,7 +21,7 @@ export function TeamEditForm({
allowEdit?: boolean;
onSave?: () => void;
}) {
const team = useContext(TeamContext);
const team = useTeam();
const { formatMessage, labels, messages } = useMessages();
const { post, useMutation } = useApi();
const { toast } = useToast();