import type { ComponentProps, ReactNode } from 'react' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@evobgp/ui/components/tabs' import { cn } from '@evobgp/ui/lib/utils' import { Badge } from '@/components/reui/badge' export type SegmentedTabItem = { value: string label: string count?: number badgeVariant?: ComponentProps['variant'] icon?: ReactNode } interface SegmentedTabsProps { items: SegmentedTabItem[] value?: string defaultValue?: string onValueChange?: (value: string) => void children: ReactNode className?: string listClassName?: string contentClassName?: string } /** * Page-level section switcher — native shadcn Tabs, default (segmented) list. * @see https://reui.io/preview/base/components/c-tabs-9 * @see https://reui.io/components/tabs */ export function SegmentedTabs({ items, value, defaultValue, onValueChange, children, className, listClassName, contentClassName, }: SegmentedTabsProps) { return ( {items.map((item) => ( {item.icon} {item.label} {item.count !== undefined ? ( {item.count} ) : null} ))}
{children}
) } export { TabsContent }