import { t } from '../i18n' import { BarChart3, Home, LibraryBig, Search, Settings } from 'lucide-react' import { cx } from '../lib/utils' export type Tab = 'home' | 'catalog' | 'stats' | 'settings' const ITEMS: { tab: Tab; readonly label: string; Icon: typeof Home }[] = [ { tab: 'home', get label() { return t('nav.home') }, Icon: Home }, { tab: 'catalog', get label() { return t('nav.catalog') }, Icon: LibraryBig }, { tab: 'stats', get label() { return t('nav.stats') }, Icon: BarChart3 }, { tab: 'settings', get label() { return t('nav.settings') }, Icon: Settings }, ] interface Props { current: Tab onChange: (tab: Tab) => void onAdd: () => void } export default function BottomNav({ current, onChange, onAdd }: Props) { const button = ({ tab, label, Icon }: (typeof ITEMS)[number]) => { const active = current === tab return ( onChange(tab)} aria-current={active ? 'page' : undefined} className={cx('flex flex-1 flex-col items-center gap-1 pb-1.5 pt-2.5 text-[11px] font-medium transition-colors', active ? 'text-ink' : 'text-ink-3')} > {label} {/* soulignement fin, comme le lien actif de rdacet.fr */} ) } return ( {ITEMS.slice(0, 2).map(button)} {ITEMS.slice(2).map(button)} ) }