2022-02-24 23:22:56 +00:00
|
|
|
import { Meta, Story } from '@storybook/react';
|
2022-11-28 02:00:28 +00:00
|
|
|
import { List } from 'lucide-react';
|
2022-02-24 23:22:56 +00:00
|
|
|
|
2022-06-17 16:18:42 +00:00
|
|
|
import { Link } from '@@/Link';
|
2022-11-28 02:00:28 +00:00
|
|
|
import { IconProps } from '@@/Icon';
|
2022-02-24 23:22:56 +00:00
|
|
|
|
|
|
|
import { DashboardItem } from './DashboardItem';
|
|
|
|
|
|
|
|
const meta: Meta = {
|
|
|
|
title: 'Components/DashboardItem',
|
|
|
|
component: DashboardItem,
|
|
|
|
};
|
|
|
|
export default meta;
|
|
|
|
|
|
|
|
interface StoryProps {
|
|
|
|
value: number;
|
2022-11-28 02:00:28 +00:00
|
|
|
icon: IconProps['icon'];
|
2022-02-24 23:22:56 +00:00
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
function Template({ value, icon, type }: StoryProps) {
|
2024-04-11 00:11:38 +00:00
|
|
|
return (
|
|
|
|
<DashboardItem
|
|
|
|
value={value}
|
|
|
|
icon={icon}
|
|
|
|
type={type}
|
2024-05-20 06:34:51 +00:00
|
|
|
data-cy="data-cy-example"
|
2024-04-11 00:11:38 +00:00
|
|
|
/>
|
|
|
|
);
|
2022-02-24 23:22:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const Primary: Story<StoryProps> = Template.bind({});
|
|
|
|
Primary.args = {
|
|
|
|
value: 1,
|
2022-11-28 02:00:28 +00:00
|
|
|
icon: List,
|
2022-02-24 23:22:56 +00:00
|
|
|
type: 'Example resource',
|
|
|
|
};
|
|
|
|
|
|
|
|
export function WithLink() {
|
|
|
|
return (
|
2024-04-11 00:11:38 +00:00
|
|
|
<Link to="example.page" data-cy="data-cy-example">
|
|
|
|
<DashboardItem
|
|
|
|
value={1}
|
|
|
|
icon={List}
|
|
|
|
type="Example resource"
|
2024-05-20 06:34:51 +00:00
|
|
|
data-cy="data-cy-example"
|
2024-04-11 00:11:38 +00:00
|
|
|
/>
|
2022-02-24 23:22:56 +00:00
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
2022-07-06 08:23:53 +00:00
|
|
|
|
|
|
|
export function WithChildren() {
|
|
|
|
return (
|
2024-04-11 00:11:38 +00:00
|
|
|
<DashboardItem
|
|
|
|
value={1}
|
|
|
|
icon={List}
|
|
|
|
type="Example resource"
|
2024-05-20 06:34:51 +00:00
|
|
|
data-cy="data-cy-example"
|
2024-04-11 00:11:38 +00:00
|
|
|
>
|
2022-07-06 08:23:53 +00:00
|
|
|
<div>Children</div>
|
|
|
|
</DashboardItem>
|
|
|
|
);
|
|
|
|
}
|