|
| 1 | +/* eslint-disable import/no-extraneous-dependencies */ |
| 2 | +import React from 'react'; |
| 3 | +import type { Meta, StoryObj } from '@storybook/react'; |
| 4 | +import Timeline from '@components/timeline'; |
| 5 | +import { EventProps } from '@components/timeline/components/Event'; |
| 6 | +import Tag from '@components/content-presentation/tag/Tag'; |
| 7 | + |
| 8 | +const meta: Meta<typeof Timeline> = { |
| 9 | + title: 'Extensions/Timeline', |
| 10 | + component: Timeline, |
| 11 | +}; |
| 12 | +export default meta; |
| 13 | + |
| 14 | +type Story = StoryObj<typeof Timeline>; |
| 15 | + |
| 16 | +const actionStyle = { |
| 17 | + marginLeft: '8px', |
| 18 | + color: '#768692', |
| 19 | +}; |
| 20 | +const tagStyle = { |
| 21 | + marginLeft: '8px', |
| 22 | +}; |
| 23 | +const linkStyle = { |
| 24 | + marginLeft: '8px', |
| 25 | + fontWeight: 400, |
| 26 | +}; |
| 27 | + |
| 28 | +const storybookEvents: EventProps[] = [ |
| 29 | + { |
| 30 | + title: <>Result sent</>, |
| 31 | + instigator: <>System</>, |
| 32 | + date: '19 Nov 2019, 7:49:10 pm', |
| 33 | + description: [ |
| 34 | + <>Test Result: (39S) Low-grade dyskaryosis, HPV positive, Repeat Advised</>, |
| 35 | + <>Test Date: 19-Oct-2020, 9:00:00 am</>, |
| 36 | + ], |
| 37 | + action: ( |
| 38 | + <span style={actionStyle}> |
| 39 | + - |
| 40 | + <Tag style={tagStyle} color="yellow"> |
| 41 | + Send to printer |
| 42 | + </Tag> |
| 43 | + <a style={linkStyle} href="/placeholder/"> |
| 44 | + Cancel |
| 45 | + </a> |
| 46 | + </span> |
| 47 | + ), |
| 48 | + }, |
| 49 | + { |
| 50 | + title: <>Patient deferred</>, |
| 51 | + instigator: <>James Smith</>, |
| 52 | + date: '19 Nov 2019, 4:28:57 pm', |
| 53 | + description: [ |
| 54 | + <>Defer Reason: Pregnancy</>, |
| 55 | + <>CRM Case Number: CAS-12345-ABCDE</>, |
| 56 | + <>Comments: Requested via the GP form</>, |
| 57 | + ], |
| 58 | + }, |
| 59 | + { |
| 60 | + title: <>Next test due date changed</>, |
| 61 | + instigator: <>System</>, |
| 62 | + date: '19 Nov 2019, 11:59:59 am', |
| 63 | + description: [<>Next test due date changed to 10-Oct-2021</>], |
| 64 | + }, |
| 65 | + { |
| 66 | + title: <>Test result added</>, |
| 67 | + date: '19 Nov 2019, 9:12:42 am', |
| 68 | + description: [<>Test Result: (39S) Low-grade dyskaryosis, HPV positive, Repeat Advised</>], |
| 69 | + }, |
| 70 | + { |
| 71 | + title: <>Screening invitation sent</>, |
| 72 | + date: '18 Nov 2019, 7:49:10 pm', |
| 73 | + action: ( |
| 74 | + <span style={actionStyle}> |
| 75 | + - |
| 76 | + <Tag style={tagStyle} color="grey"> |
| 77 | + Sent to patient |
| 78 | + </Tag> |
| 79 | + <a style={linkStyle} href="/placeholder2"> |
| 80 | + Resend |
| 81 | + </a> |
| 82 | + </span> |
| 83 | + ), |
| 84 | + }, |
| 85 | +]; |
| 86 | + |
| 87 | +export const Standard: Story = { |
| 88 | + render: () => <Timeline events={storybookEvents} />, |
| 89 | +}; |
0 commit comments