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>
);