import { Story } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { FC, LinkHTMLAttributes, useState } from 'react'; import { BlockProvider, BlocksProvider } from '../Provider'; import RichText from './RichText'; import { tw } from 'twind'; import { PreviewInStory } from './PreviewInStory'; import { BlockLoader } from '../BlockLoader'; export default { title: 'Blocks/RichText', }; const Link: FC = ({ children, href, }: LinkHTMLAttributes) => { return ; }; const Loading = () => { return
wait for it
; }; const DownIcon = () => null; const SchemaForm = () => null; const Template: Story = (config) => { return (
{RichText.Preview && }
); }; export const Default = Template.bind({}); Default.args = { content: `

HTML

Hello World

# Markdown This is some __markdown__ content with [link](https://prisme.ai). `, }; export const OneTag = Template.bind({}); OneTag.args = { content: `# Just a title`, }; export const NestedDivs = Template.bind({}); NestedDivs.args = { content: `
Hello
`, }; export const WithScript = Template.bind({}); WithScript.args = { content: ` `, allowScripts: true, }; export const WithLinks = Template.bind({}); WithLinks.args = { content: `Prisme.ai Prisme.ai too `, }; export const WithTemplate = Template.bind({}); WithTemplate.args = { content: `
{{title}}
{{text}}
`, values: { title: 'The title', text: 'The text', }, };