import { FormSubmitButton, Form, FormField, FormButtons, TextField } from '@umami/react-zen'; import { useMessages, useUpdateQuery, useWebsite } from '@/components/hooks'; import { DOMAIN_REGEX } from '@/lib/constants'; export function WebsiteEditForm({ websiteId, onSave }: { websiteId: string; onSave?: () => void }) { const website = useWebsite(); const { formatMessage, labels, messages, getErrorMessage } = useMessages(); const { mutate, error, touch, toast } = useUpdateQuery(`/websites/${websiteId}`); const handleSubmit = async (data: any) => { mutate(data, { onSuccess: async () => { toast(formatMessage(messages.saved)); touch(`website:${website.id}`); onSave?.(); }, }); }; return (
{formatMessage(labels.save)}
); }