2022-06-23 07:25:56 +00:00
|
|
|
import { Meta, Story } from '@storybook/react';
|
2022-11-28 02:00:28 +00:00
|
|
|
import { Clock, Icon } from 'lucide-react';
|
2022-06-23 07:25:56 +00:00
|
|
|
|
|
|
|
import { SidebarItem } from '.';
|
|
|
|
|
|
|
|
const meta: Meta = {
|
|
|
|
title: 'Sidebar/SidebarItem',
|
|
|
|
component: SidebarItem,
|
|
|
|
};
|
|
|
|
export default meta;
|
|
|
|
|
|
|
|
interface StoryProps {
|
2022-06-28 07:42:42 +00:00
|
|
|
icon?: Icon;
|
2022-06-23 07:25:56 +00:00
|
|
|
label: string;
|
|
|
|
}
|
|
|
|
|
2022-06-28 07:42:42 +00:00
|
|
|
function Template({ icon, label }: StoryProps) {
|
2022-06-23 07:25:56 +00:00
|
|
|
return (
|
|
|
|
<ul className="sidebar">
|
2022-06-28 07:42:42 +00:00
|
|
|
<SidebarItem
|
|
|
|
to="example.path"
|
|
|
|
params={{ endpointId: 1 }}
|
|
|
|
icon={icon}
|
|
|
|
label={label}
|
2024-04-11 00:11:38 +00:00
|
|
|
data-cy="sidebar-item"
|
2022-06-28 07:42:42 +00:00
|
|
|
/>
|
2022-06-23 07:25:56 +00:00
|
|
|
</ul>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Primary: Story<StoryProps> = Template.bind({});
|
|
|
|
Primary.args = {
|
2022-06-28 07:42:42 +00:00
|
|
|
icon: Clock,
|
2022-06-23 07:25:56 +00:00
|
|
|
label: 'Item with icon',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const WithoutIcon: Story<StoryProps> = Template.bind({});
|
|
|
|
WithoutIcon.args = {
|
|
|
|
label: 'Item without icon',
|
|
|
|
};
|