|
| 1 | +import { CodeBracketIcon } from '@heroicons/react/24/outline'; |
| 2 | +import type { Meta as MetaObj, StoryObj } from '@storybook/react'; |
| 3 | +import Image from 'next/image'; |
| 4 | +import { FormattedMessage } from 'react-intl'; |
| 5 | + |
| 6 | +import AvatarGroup from '@/components/Common/AvatarGroup'; |
| 7 | +import LocalizedLink from '@/components/LocalizedLink'; |
| 8 | + |
| 9 | +import MetaBar from './index'; |
| 10 | + |
| 11 | +type Story = StoryObj<typeof MetaBar>; |
| 12 | +type Meta = MetaObj<typeof MetaBar>; |
| 13 | + |
| 14 | +export const Default: Story = { |
| 15 | + args: { |
| 16 | + items: { |
| 17 | + 'components.metabar.lastUpdated': new Date().toLocaleDateString(), |
| 18 | + 'components.metabar.readingTime': '15 minutes', |
| 19 | + 'components.metabar.addedIn': 'v1.0.0', |
| 20 | + 'components.metabar.author': 'The Node.js Project', |
| 21 | + 'components.metabar.authors': ( |
| 22 | + <AvatarGroup |
| 23 | + avatars={[ |
| 24 | + { |
| 25 | + src: 'https://avatars.githubusercontent.com/canerakdas', |
| 26 | + alt: 'Caner Akdas', |
| 27 | + }, |
| 28 | + { |
| 29 | + src: 'https://avatars.githubusercontent.com/bmuenzenmeyer', |
| 30 | + alt: 'Brian Muenzenmeyer', |
| 31 | + }, |
| 32 | + { |
| 33 | + src: 'https://avatars.githubusercontent.com/ovflowd', |
| 34 | + alt: 'Claudio W', |
| 35 | + }, |
| 36 | + ]} |
| 37 | + /> |
| 38 | + ), |
| 39 | + 'components.metabar.contribute': ( |
| 40 | + <> |
| 41 | + <Image |
| 42 | + src="/static/images/logos/social-github-dark.svg" |
| 43 | + alt="GitHub Logo" |
| 44 | + width={16} |
| 45 | + height={16} |
| 46 | + data-on-light |
| 47 | + /> |
| 48 | + <Image |
| 49 | + src="/static/images/logos/social-github.svg" |
| 50 | + alt="GitHub Logo" |
| 51 | + width={16} |
| 52 | + height={16} |
| 53 | + data-on-dark |
| 54 | + /> |
| 55 | + <LocalizedLink href="/contribute"> |
| 56 | + <FormattedMessage id="components.metabar.contributeText" /> |
| 57 | + </LocalizedLink> |
| 58 | + </> |
| 59 | + ), |
| 60 | + 'components.metabar.viewAs': ( |
| 61 | + <> |
| 62 | + <CodeBracketIcon /> |
| 63 | + <LocalizedLink href="/json">JSON</LocalizedLink> |
| 64 | + </> |
| 65 | + ), |
| 66 | + }, |
| 67 | + headings: { |
| 68 | + items: [ |
| 69 | + { |
| 70 | + value: 'OpenSSL update assessment, and Node.js project plans', |
| 71 | + depth: 1, |
| 72 | + data: { id: 'heading-1' }, |
| 73 | + }, |
| 74 | + { |
| 75 | + value: 'Summary', |
| 76 | + depth: 2, |
| 77 | + data: { id: 'summary' }, |
| 78 | + }, |
| 79 | + { |
| 80 | + value: 'Analysis', |
| 81 | + depth: 2, |
| 82 | + data: { id: 'analysis' }, |
| 83 | + }, |
| 84 | + { |
| 85 | + value: 'The c_rehash script allows command injection (CVE-2022-2068)', |
| 86 | + depth: 3, |
| 87 | + data: { id: 'the_c_rehash' }, |
| 88 | + }, |
| 89 | + { |
| 90 | + value: 'Contact and future updates', |
| 91 | + depth: 3, |
| 92 | + data: { id: 'contact_and_future_updates' }, |
| 93 | + }, |
| 94 | + ], |
| 95 | + }, |
| 96 | + }, |
| 97 | +}; |
| 98 | + |
| 99 | +export default { component: MetaBar } as Meta; |
0 commit comments