2023-12-15 17:34:50 +03:00
|
|
|
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-08-27 15:39:49 +03:00
|
|
|
interface ConceptTabProps
|
2023-12-18 19:42:27 +03:00
|
|
|
extends Omit<TabProps, 'children'> {
|
2023-11-30 17:47:37 +03:00
|
|
|
label?: string
|
2023-08-27 15:39:49 +03:00
|
|
|
}
|
|
|
|
|
2023-12-21 00:12:24 +03:00
|
|
|
function ConceptTab({
|
|
|
|
label, title, className,
|
|
|
|
...otherProps
|
|
|
|
}: ConceptTabProps) {
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-07-25 20:27:29 +03:00
|
|
|
<Tab
|
2023-12-15 17:34:50 +03:00
|
|
|
className={clsx(
|
2023-12-18 20:45:33 +03:00
|
|
|
'min-w-[6rem]',
|
2023-12-15 17:34:50 +03:00
|
|
|
'px-2 py-1 flex justify-center',
|
|
|
|
'clr-tab',
|
|
|
|
'text-sm whitespace-nowrap small-caps font-semibold',
|
|
|
|
'select-none hover:cursor-pointer',
|
|
|
|
className
|
|
|
|
)}
|
2023-12-21 00:12:24 +03:00
|
|
|
data-tooltip-id={title ? (globalIDs.tooltip) : undefined}
|
|
|
|
data-tooltip-content={title}
|
2023-07-15 17:46:19 +03:00
|
|
|
{...otherProps}
|
|
|
|
>
|
2023-11-30 17:47:37 +03:00
|
|
|
{label}
|
2023-12-13 14:32:57 +03:00
|
|
|
</Tab>);
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ConceptTab.tabsRole = 'Tab';
|
|
|
|
|
2023-12-15 17:34:50 +03:00
|
|
|
export default ConceptTab;
|