From 6d1732d04916b0ff56fdb7f6ec2dba6a1705d2af Mon Sep 17 00:00:00 2001 From: p-sw Date: Tue, 4 Jun 2024 22:40:11 +0900 Subject: [PATCH] feat: add SyntaxHighlighter instead of deprecated Highlight --- packages/react/src/components/LoadedCode.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/react/src/components/LoadedCode.tsx b/packages/react/src/components/LoadedCode.tsx index 237cc86..c458847 100644 --- a/packages/react/src/components/LoadedCode.tsx +++ b/packages/react/src/components/LoadedCode.tsx @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; -import Highlight from "react-highlight"; +import SyntaxHighlighter from "react-syntax-highlighter"; +import { gruvboxDark } from "react-syntax-highlighter/dist/cjs/styles/hljs"; import { Button } from "@components/Button"; import { useToast } from "@components/Toast"; import { twMerge } from "tailwind-merge"; @@ -59,13 +60,14 @@ export const LoadedCode = ({ /> - {state ?? ""} - + ); };