import { Alert, Box, Title, Text } from '@mantine/core'; import { StandardTags } from '@microsoft/tsdoc'; import type { ReactNode } from 'react'; import { VscWarning } from 'react-icons/vsc'; export interface BlockProps { children: ReactNode; title: string; } export function Block({ children, title }: BlockProps) { return ( {title} {children} ); } export interface BlockCommentProps { tagName: string; children: ReactNode; index?: number | undefined; } export interface ExampleBlockProps { children: ReactNode; exampleIndex?: number | undefined; } export function ExampleBlock({ children, exampleIndex }: ExampleBlockProps): JSX.Element { return {children}; } export function DeprecatedBlock({ children }: { children: ReactNode }): JSX.Element { return ( } title="Deprecated" variant="outline" color="red" radius="xs"> {children} ); } export function DefaultValueBlock({ children }: { children: ReactNode }): JSX.Element { return {children}; } export function RemarksBlock({ children }: { children: ReactNode }): JSX.Element { return {children}; } export function BlockComment({ children, tagName, index }: BlockCommentProps): JSX.Element { switch (tagName.toUpperCase()) { case StandardTags.example.tagNameWithUpperCase: return {children}; case StandardTags.deprecated.tagNameWithUpperCase: return {children}; case StandardTags.remarks.tagNameWithUpperCase: return {children}; case StandardTags.defaultValue.tagNameWithUpperCase: return {children}; case StandardTags.typeParam.tagNameWithUpperCase: case StandardTags.param.tagNameWithUpperCase: return {children}; default: // TODO: Support more blocks in the future. return <>{children}; } }