import Login from '@/features/auth/ui/Login';
import { Metadata } from 'next';
import { Suspense } from 'react';

interface Props {
  params: { locale: 'uz' | 'ru' };
}

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { locale } = await params;

  const titles = {
    uz: 'Tizimga kirish | GASTRO',
    ru: 'Вход в систему | GASTRO',
  };

  const descriptions = {
    uz: 'Onlayn do‘konimizga tizimga kirish uchun login va parolingizni kiriting. Tez va xavfsiz kirish imkoniyati.',
    ru: 'Введите ваш логин и пароль для входа в наш онлайн-магазин. Быстрый и безопасный вход.',
  };

  const keywords = {
    uz: 'login, tizimga kirish, mahsulotlar do‘koni, parol',
    ru: 'логин, вход, магазин товаров, пароль',
  };

  return {
    title: titles[locale],
    description: descriptions[locale],
    keywords: keywords[locale],
    openGraph: {
      title: titles[locale],
      description: descriptions[locale],
      siteName: 'GASTRO',
      images: [
        {
          url: '/logos/logo.png', // public papkadan
          width: 1200,
          height: 1200,
          alt: titles[locale],
        },
      ],
      locale: locale === 'uz' ? 'uz_UZ' : 'ru_RU',
      type: 'website',
    },
    twitter: {
      card: 'summary_large_image',
      title: titles[locale],
      description: descriptions[locale],
      images: ['/logos/logo.png'],
    },
  };
}

const page = () => {
  return (
    <Suspense>
      <Login />
    </Suspense>
  );
};

export default page;
