2023-02-16 22:39:57 +00:00
|
|
|
import type { HorizontalTabItemProps } from "./HorizontalTabItem";
|
|
|
|
import HorizontalTabItem from "./HorizontalTabItem";
|
2022-07-27 22:12:27 +00:00
|
|
|
|
2022-09-18 23:14:57 +00:00
|
|
|
export interface NavTabProps {
|
|
|
|
tabs: HorizontalTabItemProps[];
|
2023-07-18 21:18:08 +00:00
|
|
|
linkShallow?: boolean;
|
|
|
|
linkScroll?: boolean;
|
2022-11-30 20:51:44 +00:00
|
|
|
actions?: JSX.Element;
|
2022-07-27 22:12:27 +00:00
|
|
|
}
|
|
|
|
|
2023-07-18 21:18:08 +00:00
|
|
|
const HorizontalTabs = function ({ tabs, linkShallow, linkScroll, actions, ...props }: NavTabProps) {
|
2022-07-27 22:12:27 +00:00
|
|
|
return (
|
2023-02-03 16:49:33 +00:00
|
|
|
<div className="mb-4 h-9 max-w-[calc(100%+40px)] lg:mb-5">
|
2023-01-17 16:36:06 +00:00
|
|
|
<nav
|
2023-01-19 12:05:00 +00:00
|
|
|
className="no-scrollbar flex max-h-9 space-x-1 overflow-scroll rounded-md"
|
2023-01-17 16:36:06 +00:00
|
|
|
aria-label="Tabs"
|
|
|
|
{...props}>
|
2022-07-27 22:12:27 +00:00
|
|
|
{tabs.map((tab, idx) => (
|
2023-07-18 21:18:08 +00:00
|
|
|
<HorizontalTabItem
|
|
|
|
className="px-4 py-2.5"
|
|
|
|
{...tab}
|
|
|
|
key={idx}
|
|
|
|
linkShallow={linkShallow}
|
|
|
|
linkScroll={linkScroll}
|
|
|
|
/>
|
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;
|