import { withI18n } from '~/lib/i18n/with-i18n';

import { loadCurrentUserAccount } from '../../_lib/server/load-user-account';
import AccountPreferencesForm from '../_components/account-preferences-form';
import SettingsSectionHeader from '../_components/settings-section-header';

async function PreferencesPage() {
  const { account } = await loadCurrentUserAccount();

  return (
    <div className="mx-auto w-full bg-white p-6">
      <div className="space-y-6">
        <SettingsSectionHeader
          titleKey="account:preferencesTabLabel"
          descriptionKey="account:preferencesTabDescription"
        />
        <AccountPreferencesForm account={account} />
      </div>
    </div>
  );
}

export default withI18n(PreferencesPage);
