aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/links/link/link.stories.tsx
blob: 30b0eabfaca68732fa6fa3f0e0620fffd5101b11 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import type { Meta, StoryObj } from '@storybook/react';
import { Link } from './link';

const meta = {
  component: Link,
  title: 'Atoms/Links',
} satisfies Meta<typeof Link>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
  args: {
    children: 'A link',
    href: '#link',
  },
};

export const WithLang: Story = {
  args: {
    children: 'Github repository',
    href: 'https://github.com/ArmandPhilippot/apcom',
    lang: 'en',
  },
  render: (args) => (
    <>
      Go to the <Link {...args} />.
    </>
  ),
};

export const DownloadLink: Story = {
  args: {
    children: 'Download the file',
    href: '#file',
    isDownload: true,
  },
};

export const DownloadLinkWithLang: Story = {
  args: {
    children: 'Download the file',
    href: '#file',
    isDownload: true,
    lang: 'en',
  },
};

export const ExternalLink: Story = {
  args: {
    children: 'Go to the Github repository',
    href: 'https://github.com/ArmandPhilippot/apcom',
    isExternal: true,
  },
};

export const ExternalLinkWithLang: Story = {
  args: {
    children: 'Go to the Github repository',
    href: 'https://github.com/ArmandPhilippot/apcom',
    isExternal: true,
    lang: 'en',
  },
};

export const ExternalDownloadLink: Story = {
  args: {
    children: 'Download the file',
    href: '#file',
    isDownload: true,
    isExternal: true,
  },
};

export const ExternalDownloadLinkWithLang: Story = {
  args: {
    children: 'Download the file',
    href: '#file',
    isDownload: true,
    isExternal: true,
    lang: 'en',
  },
};