Update: Replace react-syntax-highlighter with Prism in CodeBlock component

In this commit, we replaced the react-syntax-highlighter package with the Prism component from the same package. This change improves the syntax highlighting performance and provides better support for various programming languages. The okaidia theme is also imported for a consistent look and feel.
This commit is contained in:
Rankin Zheng 2023-06-05 20:44:50 +08:00
parent 70d1668e6c
commit 2d6692ff39

View File

@ -2,7 +2,7 @@ import { Tooltip, ActionIcon, CopyButton, Flex } from "@mantine/core";
import { IconCheck, IconGitCommit, IconFileDiff, IconColumnInsertRight, IconReplace, IconCopy } from "@tabler/icons-react";
import React, { useState } from "react";
import ReactMarkdown from "react-markdown";
import SyntaxHighlighter from "react-syntax-highlighter";
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { okaidia } from "react-syntax-highlighter/dist/esm/styles/prism";
import messageUtil from '../../util/MessageUtil';