import { Users, UserRound } from 'lucide-react' import type { PackingState } from './usePackingListPanel' /** * One tab row: the three-tier view switch (Gemeinsam / Meine Liste, #858) on the * left, and the all/open/done filter on the right, separated by a vertical rule * and sharing the same height. Left-aligned with the list content. */ export function PackingViewTabs(S: PackingState) { const { view, setView, filter, setFilter, t, items } = S const commonCount = items.filter(i => !i.is_private).length const personalCount = items.filter(i => !!i.is_private).length const pillBase: React.CSSProperties = { display: 'inline-flex', alignItems: 'center', gap: 6, height: 30, padding: '0 12px', borderRadius: 999, border: '1px solid', cursor: 'pointer', fontFamily: 'inherit', fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 600, transition: 'all 0.12s', } const viewPill = (id: 'common' | 'personal', icon: React.ReactNode, label: string, count: number) => { const active = view === id return ( ) } const filterPill = (id: string, label: string) => { const active = filter === id return ( ) } return (
{viewPill('common', , t('packing.viewCommon'), commonCount)} {viewPill('personal', , t('packing.viewPersonal'), personalCount)} {items.length > 0 && ( <> {filterPill('alle', t('packing.filterAll'))} {filterPill('offen', t('packing.filterOpen'))} {filterPill('erledigt', t('packing.filterDone'))} )}
) }