'use client' import type { FC } from 'react' import React from 'react' import s from './style.module.css' import cn from '@/utils/classnames' type Item = { id: string name: string isRight?: boolean extra?: React.ReactNode } export type ITabHeaderProps = { items: Item[] value: string onChange: (value: string) => void } const TabHeader: FC = ({ items, value, onChange, }) => { const renderItem = ({ id, name, extra }: Item) => (
onChange(id)} >
{name}
{extra || ''}
) return (
{items.filter(item => !item.isRight).map(renderItem)}
{items.filter(item => item.isRight).map(renderItem)}
) } export default React.memo(TabHeader)