import {Box, Heading} from '@chakra-ui/react' import {ComponentMeta, Story} from '@storybook/react' import React from 'react' import Component from '.' import {Field} from '..' import {JaenPageProvider} from '../../internal/services/page' import {EditButton} from '../../ui/toolbar' const JaenPage = { id: `JaenPage jaen-page-2`, slug: 'jaen-page-1', parent: null, children: [ { id: `JaenPage jaen-page-3`, slug: 'jaen-page-3' } ], jaenPageMetadata: { title: 'Jaen Page 1', description: 'Jaen Page 1 description', image: 'https://via.placeholder.com/300x200', canonical: 'https://jaen.com/jaen-page-1', datePublished: '2020-01-01', isBlogPost: false }, jaenFields: { 'IMA:TextField': { 'rich-text-field-1': { value: '

this is a stored rtf value

' } } }, chapters: {}, template: 'BlogPage', jaenFiles: [] } export default { title: 'fields/IndexField', component: Component, decorators: [ Story => ( ) ] } as ComponentMeta type ComponentProps = React.ComponentProps // Create a template for the component const Template: Story = args => export const Basic: Story = Template.bind({}) Basic.args = { renderPage: page => ( {page.id} {page.slug} ) } export const CustomId: Story = Template.bind({}) CustomId.args = { jaenPageId: 'JaenPage jaen-page-2', renderPage: page => ( {page.id} {page.slug} ) }