2022-07-27 22:12:27 +00:00
|
|
|
import HorizontalTabItem, { HorizontalTabItemProps } from "./HorizontalTabItem";
|
|
|
|
|
2022-09-18 23:14:57 +00:00
|
|
|
export interface NavTabProps {
|
|
|
|
tabs: HorizontalTabItemProps[];
|
|
|
|
linkProps?: HorizontalTabItemProps["linkProps"];
|
2022-11-30 20:51:44 +00:00
|
|
|
actions?: JSX.Element;
|
2022-07-27 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2022-11-30 20:51:44 +00:00
|
|
|
const HorizontalTabs = function ({ tabs, linkProps, actions, ...props }: NavTabProps) {
|
2022-07-27 22:12:27 +00:00
|
|
|
return (
|
2023-01-17 16:36:06 +00:00
|
|
|
<div className="mb-2 h-9 max-w-[calc(100%+40px)] lg:mb-5">
|
|
|
|
<nav
|
|
|
|
className="no-scrollbar flex max-h-9 space-x-1 overflow-scroll rounded-md border p-1"
|
|
|
|
aria-label="Tabs"
|
|
|
|
{...props}>
|
2022-07-27 22:12:27 +00:00
|
|
|
{tabs.map((tab, idx) => (
|
2022-09-18 23:14:57 +00:00
|
|
|
<HorizontalTabItem {...tab} key={idx} {...linkProps} />
|
2022-07-27 22:12:27 +00:00
|
|
|
))}
|
|
|
|
</nav>
|
2022-11-30 20:51:44 +00:00
|
|
|
{actions && actions}
|
2022-09-06 09:06:39 +00:00
|
|
|
</div>
|
2022-07-27 22:12:27 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default HorizontalTabs;
|