aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/meta-list/meta-list.stories.tsx
blob: f6015bdb876ebad6e859529d5a6914fa5e21290b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import type { Meta, StoryObj } from '@storybook/react';
import { Link } from '../../atoms';
import { MetaItem } from './meta-item';
import { MetaList } from './meta-list';

const meta = {
  component: MetaList,
  title: 'Molecules/MetaList',
} satisfies Meta<typeof MetaList>;

export default meta;

type Story = StoryObj<typeof meta>;

const items = [
  { id: 'comments', label: 'Comments', value: 'No comments.' },
  {
    id: 'category',
    label: 'Category',
    value: <Link href="#cat1">Cat 1</Link>,
  },
  {
    id: 'tags',
    label: 'Tags',
    value: [
      { id: 'tag1', value: <Link href="#tag1">Tag 1</Link> },
      { id: 'tag2', value: <Link href="#tag2">Tag 2</Link> },
    ],
  },
  {
    hasBorderedValues: true,
    hasInlinedValues: true,
    id: 'technologies',
    label: 'Technologies',
    value: [
      { id: 'techno1', value: 'HTML' },
      { id: 'techno2', value: 'CSS' },
      { id: 'techno3', value: 'Javascript' },
    ],
  },
];

export const Example: Story = {
  args: {
    children: items.map(({ id, ...item }) => <MetaItem key={id} {...item} />),
  },
};

export const Inlined: Story = {
  args: {
    children: items.map(({ id, ...item }) => <MetaItem key={id} {...item} />),
    isInline: true,
  },
};