import { clx } from '@/helpers/utils' import { type FC } from 'react' type TabItem = { label: string value: string } type Props = { items: TabItem[] activeTab: string onTabChange: (tab: string) => void } const Tabs: FC = (props) => { const { items, activeTab, onTabChange } = props return (
{ items.map((item) => { return (
onTabChange(item.value)} key={item.value} className={clx( 'h-[32px] flex items-center justify-center w-[122px] cursor-pointer rounded-full', activeTab === item.value && 'bg-primary' )}> {item.label}
) }) }
) } export default Tabs