import { Briefcase, PlusCircle, FolderTree, 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 portfolioSections: {
  icon: typeof Briefcase
  titleKey: BusinessMessageKey
  descKey: BusinessMessageKey
  linkKey: BusinessMessageKey
  href: string
}[] = [
  {
    icon: Briefcase,
    titleKey: 'nav.portfolios.list',
    descKey: 'portfolio.card.list.desc',
    linkKey: 'portfolio.card.list.link',
    href: '/portfolios/list',
  },
  {
    icon: PlusCircle,
    titleKey: 'nav.portfolios.new',
    descKey: 'portfolio.card.new.desc',
    linkKey: 'portfolio.card.new.link',
    href: '/portfolios/new',
  },
  {
    icon: FolderTree,
    titleKey: 'portfolio.card.categories.title',
    descKey: 'portfolio.card.categories.desc',
    linkKey: 'portfolio.card.categories.link',
    href: '/portfolios/categories',
  },
  {
    icon: Settings,
    titleKey: 'nav.portfolios.settings',
    descKey: 'portfolio.card.settings.desc',
    linkKey: 'portfolio.card.settings.link',
    href: '/portfolios/settings',
  },
]

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

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

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