import { Meta } from '@storybook/react'; import React from 'react'; import { MagicBellThemeProvider } from '../../context/MagicBellThemeContext'; import { merge } from '../../lib/merge'; import ClickableNotification from './ClickableNotification'; const DEFAULT_NOTIFICATION = { id: 1, title: 'Lorem ipsum', content: '@John the changes in the API were approved', actionUrl: 'https://magicbell.io', sentAt: 1599900000, seenAt: 1599900000, readAt: null, }; const Component = ({ notification, onClick, theme, ...props }) => ( ); const meta: Meta = { component: Component, argTypes: { onClick: { action: 'onClick', description: 'Callback function, receives the clicked notification as the only argument', }, notification: { description: 'Notification to render' }, }, }; export default meta; export const Default = { args: { notification: DEFAULT_NOTIFICATION, }, }; const html = ` STYLED CONTENT STARTING HERE
--------------------

Heading 1

Heading 1

Heading 1

Heading 1

Heading 1
Heading 1

paragraph with a couple of words and a
linebreak

followed by a second paragraph with code and a link

which is in turn followed by a code block

ul: ol:
  1. one
  2. two
  3. three
Quote

quote in paragraph

col1 col2 col3
cell cell cell
cell cell cell
--------------------
ENDING THERE `; export const WithRichText = merge(Default, { args: { notification: { ...DEFAULT_NOTIFICATION, content: html, }, }, }); export const WithRichTextAndNoProse = merge(Default, { args: { notification: { ...DEFAULT_NOTIFICATION, content: html, }, prose: false, }, }); export const WithRelativeTimes = merge(Default, { args: { notification: { id: 1, title: 'Lorem ipsum', content: '@John the changes in the API were approved ', actionUrl: 'https://magicbell.io', sentAt: 1599900000, seenAt: 1599900000, readAt: null, }, }, });