-
Notifications
You must be signed in to change notification settings - Fork 12
/
Card.stories.tsx
64 lines (56 loc) · 1.21 KB
/
Card.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { Meta, StoryObj } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { createRegEntity } from '../../mocks';
import { Card } from './';
const defaultEntity = createRegEntity({
id: 'id',
variant: 'changed',
name: 'filename.png',
diff: 'https://via.placeholder.com/700x400?text=diff',
before: 'https://via.placeholder.com/700x400?text=before',
after: 'https://via.placeholder.com/700x400?text=after',
});
type Component = typeof Card;
type Story = StoryObj<Component>;
export default {
component: Card,
args: {
href: '?id=storybook',
entity: defaultEntity,
menus: [],
onCopy: action('onCopy'),
},
} satisfies Meta<Component>;
export const Overview: Story = {};
export const WithLongName: Story = {
args: {
entity: {
...defaultEntity,
name: 'abcdef'.repeat(20),
},
},
};
export const WithNew: Story = {
args: {
entity: {
...defaultEntity,
variant: 'new',
},
},
};
export const WithDeleted: Story = {
args: {
entity: {
...defaultEntity,
variant: 'deleted',
},
},
};
export const WithPassed: Story = {
args: {
entity: {
...defaultEntity,
variant: 'passed',
},
},
};