ConceptPortal-public/rsconcept/frontend/src/components/Common/ConceptTab.tsx

34 lines
783 B
TypeScript
Raw Normal View History

import clsx from 'clsx';
2023-07-15 17:46:19 +03:00
import type { TabProps } from 'react-tabs';
2023-07-25 20:27:29 +03:00
import { Tab } from 'react-tabs';
2023-07-15 17:46:19 +03:00
2023-12-21 00:12:24 +03:00
import { globalIDs } from '@/utils/constants';
2023-12-28 14:04:44 +03:00
interface ConceptTabProps extends Omit<TabProps, 'children'> {
label?: string;
2023-08-27 15:39:49 +03:00
}
2023-12-28 14:04:44 +03:00
function ConceptTab({ label, title, className, ...otherProps }: ConceptTabProps) {
2023-07-15 17:46:19 +03:00
return (
2023-12-28 14:04:44 +03:00
<Tab
className={clsx(
'min-w-[6rem]',
'px-2 py-1 flex justify-center',
'clr-tab',
2023-12-30 19:43:24 +03:00
'text-sm whitespace-nowrap font-controls',
2023-12-28 14:04:44 +03:00
'select-none hover:cursor-pointer',
className
)}
data-tooltip-id={title ? globalIDs.tooltip : undefined}
data-tooltip-content={title}
{...otherProps}
>
{label}
</Tab>
);
2023-07-15 17:46:19 +03:00
}
ConceptTab.tabsRole = 'Tab';
2023-12-28 14:04:44 +03:00
export default ConceptTab;