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

25 lines
615 B
TypeScript
Raw Normal View History

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-08-27 15:39:49 +03:00
interface ConceptTabProps
2023-11-30 17:47:37 +03:00
extends Omit<TabProps, 'title' | 'children'> {
2023-08-27 15:39:49 +03:00
className?: string
2023-11-06 02:20:16 +03:00
tooltip?: string
2023-11-30 17:47:37 +03:00
label?: string
2023-08-27 15:39:49 +03:00
}
2023-11-30 17:47:37 +03:00
function ConceptTab({ label, tooltip, className, ...otherProps }: ConceptTabProps) {
2023-07-15 17:46:19 +03:00
return (
2023-07-25 20:27:29 +03:00
<Tab
2023-12-01 22:50:43 +03:00
className={`px-2 py-1 h-full min-w-[6rem] flex justify-center text-sm hover:cursor-pointer clr-tab whitespace-nowrap small-caps select-none font-semibold ${className}`}
2023-11-06 02:20:16 +03:00
title={tooltip}
2023-07-15 17:46:19 +03:00
{...otherProps}
>
2023-11-30 17:47:37 +03:00
{label}
</Tab>);
2023-07-15 17:46:19 +03:00
}
ConceptTab.tabsRole = 'Tab';
2023-07-25 20:27:29 +03:00
export default ConceptTab;