import { Link, RichText, types } from 'react-bricks/rsc' import blockNames from '../../blockNames' import { containerWidthSideGroup, LayoutProps, neutralBackgroundSideGroup, paddingBordersSideGroup, sectionDefaults, } from '../../LayoutSideProps' import Container from '../../shared/components/Container' import Section from '../../shared/components/Section' interface ParagraphProps extends LayoutProps { text: types.TextValue } const Paragraph: types.Brick = ({ backgroundColor, borderTop, borderBottom, paddingTop, paddingBottom, width, text, }) => { return (
(

{children}

)} allowedFeatures={[ types.RichTextFeatures.Heading2, types.RichTextFeatures.Heading3, types.RichTextFeatures.Bold, types.RichTextFeatures.Italic, types.RichTextFeatures.Link, types.RichTextFeatures.Code, types.RichTextFeatures.Highlight, types.RichTextFeatures.UnorderedList, types.RichTextFeatures.OrderedList, ]} renderH2={({ children }) => { return (

{children}

) }} renderH3={({ children }) => { return (

{children}

) }} renderUL={({ children }) => (
    {children}
)} renderOL={({ children }) => (
    {children}
)} renderLink={({ children, href, target, rel }) => ( {children} )} />
) } Paragraph.schema = { name: blockNames.Paragraph, label: 'Paragraph', category: 'single column / blog', tags: ['blog', 'paragraph', 'text'], playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-app/src/singleColumnContent/Paragraph/Paragraph.tsx', previewImageUrl: `/bricks-preview-images/${blockNames.Paragraph}.png`, getDefaultProps: () => ({ ...sectionDefaults, width: 'small', paddingTop: '0', paddingBottom: '0', text: [ { type: 'h2', children: [ { text: 'Lorem ipsum dolor sit title', }, ], }, { type: 'paragraph', children: [ { text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc placerat sagittis faucibus.', }, ], }, ], }), sideEditProps: [ neutralBackgroundSideGroup, paddingBordersSideGroup, containerWidthSideGroup, ], } export default Paragraph