mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
chore: remove prismjs
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user