import * as React from 'react'; import styled from 'styled-components'; import { CodeBlock } from '@redocly/theme/components/CodeBlock/CodeBlock'; export interface MarkdocExampleProps { language: string; rawContent: string; renderDemo?: boolean; demoContent: React.ReactNode[]; withLabels?: boolean; codeLabel?: string; resultLabel?: string; title?: string; } export function MarkdocExample(props: MarkdocExampleProps) { const { language, rawContent, renderDemo, demoContent, withLabels, codeLabel, resultLabel, title, } = props; const renderLabels = renderDemo ? (withLabels === undefined ? true : withLabels) : false; return (
{renderLabels ? : null} {renderDemo ? <>{renderLabels ? : null} {...demoContent} : null}
); } const Label = styled.div` margin: 10px 0; `;