import { getDictionary, getLocale } from '../../lib/i18n';
import { LanguageSwitcher } from '../../components/language-switcher';
import { LoginForm } from '../../components/login-form';

export default async function LoginPage() {
  const locale = await getLocale();
  const dict = await getDictionary();

  return (
    <LoginForm
      languageSwitcher={
        <LanguageSwitcher
          currentLocale={locale}
          label={dict.common.language}
          englishLabel={dict.common.english}
          indonesianLabel={dict.common.indonesian}
          submitLabel={dict.common.save}
          variant="compact"
        />
      }
      appName={dict.common.appName}
      labels={{
        title: dict.login.title,
        description: dict.login.description,
        email: dict.login.email,
        password: dict.login.password,
        submit: dict.login.submit,
        goToDashboard: dict.login.goToDashboard,
        emailLabel: dict.login.emailLabel,
        passwordLabel: dict.login.passwordLabel,
        forgotPassword: dict.login.forgotPassword,
        rememberMe: dict.login.rememberMe,
        accessVia: dict.login.accessVia,
        google: dict.login.google,
        sso: dict.login.sso,
        newToPlatform: dict.login.newToPlatform,
        applyAccess: dict.login.applyAccess,
        privacyPolicy: dict.login.privacyPolicy,
        termsOfService: dict.login.termsOfService,
        helpCenter: dict.login.helpCenter,
        securityPreview: dict.login.securityPreview,
        loginHelp: dict.login.loginHelp,
        twoFactorPreview: dict.login.twoFactorPreview,
        showPassword: dict.login.showPassword,
        hidePassword: dict.login.hidePassword,
      }}
    />
  );
}
