import { ITag } from "@documentalist/client" ; import * as React from "react" ; export interface IDocsMap { [ name ] : React . ComponentClass ; } export class ReactDocsTagRenderer { constructor ( private docs ) { } /**
     * Given the name of a component, like `"ColorSchemes"`, attempts to resolve
     * it to an actual component class in the given map, or in the default map which contains
     * valid docs components from this package. Provide a custom map to inject your own components.
     */ public render : React . FC < ITag > = ( { value : componentName } ) => { if ( componentName == null ) { return null ; } const docsComponent = this . docs [ componentName ] ; if ( docsComponent == null ) { throw new Error ( `Unknown @reactDocs component: ${ componentName }` ) ; } return React . createElement ( docsComponent ) ; } ; }