'use client'; import {useEffect, useState} from 'react'; import {Alert, App, Button, Form, Input, Radio} from 'antd'; import type {CustomerProfile} from '@/types/account'; import {useAuth} from '@/app/context/AuthContext'; import {useLanguage} from '@/app/context/LanguageContext'; import {accountCopy} from '@/data/account'; export default function ProfilePage() { const auth = useAuth(); const {message} = App.useApp(); const {locale} = useLanguage(); const copy = accountCopy[locale]; const [form] = Form.useForm(); const [saving, setSaving] = useState(false); const customerType = Form.useWatch('type', form); useEffect(() => { if (auth.session) form.setFieldsValue(auth.session.profile); }, [auth.session, form]); const submit = async (values: CustomerProfile) => { setSaving(true); try { await auth.updateProfile(values); message.success(copy.saved); } finally { setSaving(false); } }; return <>

{copy.profile}

{copy.invoicePending}

{customerType === 'corporate' && <> }
; }