import { Tooltip } from 'antd'; import cn from 'classnames'; import React from 'react'; interface Props { i: number; tab: string; currentTab: string; changeTab?: (tab: string) => void; isLive?: boolean; isClosed?: boolean; name?: string; } function Tab({ i, tab, currentTab, changeTab, isLive, isClosed, name }: Props) { return (
changeTab?.(tab)} className={cn( 'self-end py-1 px-4 text-sm', changeTab && !isLive ? 'cursor-pointer' : 'cursor-default', currentTab === tab ? 'border-gray-lighter border-t border-l border-r !border-b-white bg-white rounded-tl rounded-tr font-semibold' : 'cursor-pointer border-gray-lighter !border-b !border-t-transparent !border-l-transparent !border-r-transparent', )} > 20 ? name : ''} mouseEnterDelay={0.5}>
{i + 1}
{name || `Tab ${i + 1}`}
); } export default Tab;