import classNames from 'classnames' import { Link, RichText, Text, types } from 'react-bricks/rsc' import blockNames from '../blockNames' import { textColors } from '../colors' export interface FaqQuestionProps { id: string question: types.TextValue answer: types.TextValue } const FaqQuestion: types.Brick = ({ id, question, answer, }) => { const idAttribute = id ? { id } : {} return (
(

{id && ( )} {props.children}

)} placeholder="Answer..." /> (

{props.children}

)} placeholder="Answer..." allowedFeatures={[types.RichTextFeatures.Link]} renderLink={({ children, href, target, rel }) => ( {children} )} />
) } FaqQuestion.schema = { name: blockNames.Faq, label: 'Question', category: 'faq', hideFromAddMenu: true, playgroundLinkLabel: 'View source code on Github', playgroundLinkUrl: 'https://github.com/ReactBricks/reactbricks-starters/blob/main/packages/reactbricks-ui/nextjs-app/src/Faq/FaqItem.tsx', getDefaultProps: () => ({ question: 'Is this the latest question?', answer: "This is either the first question or the one following the one before it. It is the last question if you did't add other questions after it.", }), sideEditProps: [ { name: 'id', label: 'Anchor ID', type: types.SideEditPropType.Text, }, ], } export default FaqQuestion