'use client'; import { useActionState } from 'react'; import { Field, FormError, SubmitButton } from '@/components/ui/Form'; import { PersistentForm } from '@/components/ui/PersistentForm'; import { saveAccountIdentityAction, type AccountIdentity, type ActionState, } from '@/server/settings/account'; const empty: ActionState = {}; export function AccountIdentityForm({ account, }: { account: AccountIdentity; }) { const [state, action] = useActionState(saveAccountIdentityAction, empty); return (
{state.error}
Enregistrer {state.ok ? ( Compte enregistré. ) : null}
); }