diff --git a/website/src/components/Route.tsx b/website/src/components/Route.tsx index 16bec5712..4f1d0b5f2 100644 --- a/website/src/components/Route.tsx +++ b/website/src/components/Route.tsx @@ -2,38 +2,19 @@ import MarkdownIt from 'markdown-it'; import Badge from './Badge'; import Translate from '@docusaurus/Translate'; import Link from '@docusaurus/Link'; +import type { Route } from '../../../lib/types'; export default function Route({ - author = 'DIYgod', - path = '', - example = '', - paramsDesc = 'N/A', - anticrawler = null, - supportBT = null, - supportPodcast = null, - supportScihub = null, - radar = null, - configRequired = null, - puppeteer = null, - notOperational = null, + namespace, + data, children = null, }: { - author?: string; - path: string; - example?: string; - paramsDesc?: string; - anticrawler?: boolean; - supportBT?: boolean; - supportPodcast?: boolean; - supportScihub?: boolean; - radar?: boolean; - configRequired?: boolean; - puppeteer?: boolean; - notOperational?: boolean; + namespace: string, + data: Route; children?: JSX.Element | JSX.Element[]; }): JSX.Element { - const demoUrl = 'https://rsshub.app' + example; - const paramMatch = path.match(/(?<=:).*?(?=\/|$)/g); + const demoUrl = 'https://rsshub.app' + data.example; + const paramMatch = data.path.match?.(/(?<=:).*?(?=\/|$)/g); const renderMarkdown = (item, inline = true) => { const md = new MarkdownIt({ @@ -43,28 +24,23 @@ export default function Route({ }; return ( -
- {notOperational && (
-
-
- {path}
+ {data.path}