import {
  Package,
  ShoppingCart,
  Truck,
  CreditCard,
  Settings,
} from 'lucide-react'
import { SectionCard } from '../components/SectionCard'
import { Breadcrumbs } from '../components/Breadcrumbs'
import { useT } from '../i18n/useT'
import type { BusinessMessageKey } from '../i18n/messages'
import styles from '../components/PageContent.module.css'

const storeSections: {
  icon: typeof Package
  titleKey: BusinessMessageKey
  descKey: BusinessMessageKey
  href: string
}[] = [
  {
    icon: Package,
    titleKey: 'nav.store.items',
    descKey: 'store.card.items.desc',
    href: '/store/items',
  },
  {
    icon: ShoppingCart,
    titleKey: 'nav.store.orders',
    descKey: 'store.card.orders.desc',
    href: '/store/orders',
  },
  {
    icon: Truck,
    titleKey: 'nav.store.shipping',
    descKey: 'store.card.shipping.desc',
    href: '/store/shipping',
  },
  {
    icon: CreditCard,
    titleKey: 'nav.store.cards',
    descKey: 'store.card.cards.desc',
    href: '/store/cards',
  },
  {
    icon: Settings,
    titleKey: 'nav.store.settings',
    descKey: 'store.card.settings.desc',
    href: '/store/settings',
  },
]

export function StorePage() {
  const t = useT()

  return (
    <main className={styles.content}>
      <Breadcrumbs
        items={[
          { label: 'Dashboard', href: '/' },
          { label: 'Store' },
        ]}
      />
      <div className={styles.pageHeader}>
        <div>
          <h2 className={styles.pageTitle}>{t('title.store')}</h2>
          <p className={styles.pageSubtitle}>{t('store.page.subtitle')}</p>
        </div>
      </div>

      <div className={styles.gridHome}>
        {storeSections.map((section) => (
          <SectionCard
            key={section.href}
            icon={section.icon}
            title={t(section.titleKey)}
            description={t(section.descKey)}
            href={section.href}
          />
        ))}
      </div>
    </main>
  )
}
