chore: remove prismjs

This commit is contained in:
Nicolas Meienberger
2025-10-04 14:20:36 +02:00
parent 728cfebeb7
commit 56a4afdc92
3 changed files with 4 additions and 20 deletions

View File

@@ -1,8 +1,4 @@
import Prism from "prismjs";
import type React from "react";
import { useEffect } from "react";
import "prismjs/themes/prism-okaidia.css";
import "prismjs/components/prism-yaml";
import { toast } from "sonner";
import { copyToClipboard } from "~/utils/clipboard";
@@ -12,11 +8,7 @@ interface CodeBlockProps {
filename?: string;
}
export const CodeBlock: React.FC<CodeBlockProps> = ({ code, language = "jsx", filename }) => {
useEffect(() => {
Prism.highlightAll();
}, []);
export const CodeBlock: React.FC<CodeBlockProps> = ({ code, filename }) => {
const handleCopy = async () => {
await copyToClipboard(code);
toast.success("Code copied to clipboard");
@@ -29,7 +21,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({ code, language = "jsx", fi
<span className="h-2.5 w-2.5 rounded-full bg-rose-500" />
<span className="h-2.5 w-2.5 rounded-full bg-amber-500" />
<span className="h-2.5 w-2.5 rounded-full bg-emerald-500" />
{filename && <span className="ml-3 font-medium text-slate-300">{filename}</span>}
{filename && <span className="ml-3 font-medium">{filename}</span>}
</div>
<button
type="button"
@@ -39,8 +31,8 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({ code, language = "jsx", fi
Copy
</button>
</div>
<pre className="overflow-x-auto text-xs m-0" style={{ marginTop: 0, borderRadius: 0, marginBottom: 0 }}>
<code className={`language-${language}`}>{code}</code>
<pre className="text-xs m-0 px-4 py-2 bg-card-header">
<code className="text-white/80">{code}</code>
</pre>
</div>
);

View File

@@ -32,7 +32,6 @@
"isbot": "^5.1.31",
"lucide-react": "^0.544.0",
"next-themes": "^0.4.6",
"prismjs": "^1.30.0",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-hook-form": "^7.63.0",
@@ -46,7 +45,6 @@
"@react-router/dev": "^7.9.3",
"@tailwindcss/vite": "^4.1.14",
"@types/node": "^24.6.2",
"@types/prismjs": "^1.26.5",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"lightningcss": "^1.30.2",