import type { FC } from 'react' type TabProps = { active: string onSelect: (active: string) => void } const Tab: FC = ({ active, onSelect, }) => { const tabs = [ { key: 'all', text: 'All', }, { key: 'added', text: 'Added', }, { key: 'build-in', text: 'Build-in', }, ] return (
{ tabs.map(tab => (
onSelect(tab.key)} > {tab.text}
)) }
) } export default Tab