mirror of
https://github.com/nix-community/noogle.git
synced 2024-12-18 06:22:11 +03:00
d9f579cf44
* refactor to include all necessary dependencies directly here * move indexer into monorepo * add snapshot tests and seperate sub.project for builtin types * add more missing builtins such as fromTOML
23 lines
534 B
TypeScript
23 lines
534 B
TypeScript
import ReactMarkdown from "react-markdown";
|
|
import rehypeHighlight from "rehype-highlight";
|
|
import nix from "highlight.js/lib/languages/nix";
|
|
|
|
interface MarkdownPreviewProps {
|
|
description: string;
|
|
}
|
|
export const MarkdownPreview = (props: MarkdownPreviewProps) => {
|
|
const { description } = props;
|
|
return (
|
|
<ReactMarkdown
|
|
components={{
|
|
h1: "h3",
|
|
h2: "h4",
|
|
h3: "h5",
|
|
}}
|
|
rehypePlugins={[[rehypeHighlight, { languages: { nix } }]]}
|
|
>
|
|
{description}
|
|
</ReactMarkdown>
|
|
);
|
|
};
|