-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathBackButton.stories.tsx
49 lines (44 loc) · 1.15 KB
/
BackButton.stories.tsx
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
import React from 'react';
import { BackButton } from './BackButton';
import type { StoryObj, Meta } from '@storybook/react';
const meta: Meta<typeof BackButton<any>> = {
title: 'Komponenter/Buttons/BackButton',
component: BackButton,
parameters: {
docs: {
description: {
component:
'BackButton brukes for å navigere tilbake til forrige side eller visning. Den har et innebygd tilbake-ikon.',
},
},
},
argTypes: {
as: {
description: 'HTML-elementet som skal brukes',
options: ['button'],
mapping: {
'': 'button',
button: 'button',
},
},
},
};
export default meta;
type Story = StoryObj<typeof BackButton<any>>;
const buttonArgs = {
as: 'button',
};
export const Standard: Story = {
args: {
...buttonArgs,
},
render: args => <BackButton {...args}>Tilbake</BackButton>,
};
export const WithCustomText: Story = {
args: {
...buttonArgs,
},
render: args => (
<BackButton {...args}>Gå tilbake til oversikten</BackButton>
),
};