import * as React from "react" ; import { Intent , Tag } from "@blueprintjs/core" ; export const DeprecatedTag = ( { isDeprecated } ) => { if ( isDeprecated === true || typeof isDeprecated === "string" ) { return ( < Tag intent = { Intent . DANGER } minimal = { true } > { typeof isDeprecated === "string" ? ( < span dangerouslySetInnerHTML = { markdownCode ( `Deprecated: ${ isDeprecated } `)}/>) : ("Deprecated")}
            </Tag>);
    }
    return null;
};
DeprecatedTag.displayName = "Docs2.DeprecatedTag";
/**
 * Minimal markdown renderer that supports only backtick ` code ` elements and triple-backtick ` pre ` elements.
 * Does not provide any syntax highlighting.
 */
function markdownCode(text) {
    return {
        __html: text
            .replace("<", "&lt;")
            .replace(/` `` ( [ ^ `]+)` `` / g , ( _ , code ) => `<pre>${ code }</pre>` ) . replace ( /`([^`]+)`/g , ( _ , code ) => `<code>${ code }</code>` ) , } ; }