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

@ -1,4 +1,3 @@
import { useContext } from 'react';
import {
FormSubmitButton,
Form,
@ -7,12 +6,11 @@ import {
TextField,
useToast,
} from '@umami/react-zen';
import { useApi, useMessages, useModified } from '@/components/hooks';
import { useApi, useMessages, useModified, useWebsite } from '@/components/hooks';
import { DOMAIN_REGEX } from '@/lib/constants';
import { WebsiteContext } from '@/app/(main)/websites/WebsiteProvider';
export function WebsiteEditForm({ websiteId, onSave }: { websiteId: string; onSave?: () => void }) {
const website = useContext(WebsiteContext);
const website = useWebsite();
const { formatMessage, labels, messages } = useMessages();
const { post, useMutation } = useApi();
const { toast } = useToast();