import React, { useState } from "react"; import CodeBlock from "@theme/CodeBlock"; import ConfigTabs from "@site/src/components/ConfigTabs"; import TabItem from "@theme/TabItem"; import { marked } from "marked"; import styles from "./styles.module.css"; marked.setOptions({ gfm: true }); /** * @typedef {Object} Model * @property {string} key * @property {string} label * @property {boolean} recommended * @property {string} download Markdown for the "download the model" step. * @property {string} ui Markdown for the Frigate UI configuration step. * @property {string} yaml Raw YAML for the configuration step. */ // marked does not understand Docusaurus admonitions (:::warning ... :::), so // render those blocks ourselves and marked-parse everything around them. function renderMarkdown(md) { if (!md) return ""; const admonition = /:::(\w+)[ \t]*([^\n]*)\n([\s\S]*?)\n:::/g; let html = ""; let lastIndex = 0; let match; while ((match = admonition.exec(md)) !== null) { html += marked.parse(md.slice(lastIndex, match.index)); const [, type, title, body] = match; const heading = (title || type).trim(); html += `