continue-custom/gui/src/components/markdown/StyledCode.tsx
2023-11-19 17:23:27 -08:00

19 lines
492 B
TypeScript

import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { vscDarkPlus as highlightStyle } from "react-syntax-highlighter/dist/esm/styles/prism";
interface StyledCodeProps {
children: string;
language?: string;
}
const StyledCode = (props: StyledCodeProps) => (
<SyntaxHighlighter
customStyle={{ margin: "0" }}
style={highlightStyle}
language={props.language || "python"}
>
{props.children}
</SyntaxHighlighter>
);
export default StyledCode;