Fix pnpm build
This commit is contained in:
@@ -11,11 +11,13 @@ import 'prismjs/plugins/line-numbers/prism-line-numbers.js';
|
||||
import 'prismjs/themes/prism-tomorrow.css';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import { Paste } from '@/types/paste';
|
||||
|
||||
export default function CodeViewer({
|
||||
paste,
|
||||
language,
|
||||
}: {
|
||||
paste: any;
|
||||
paste: Paste;
|
||||
language: string;
|
||||
}) {
|
||||
const codeRef = useRef<HTMLPreElement | null>(null);
|
||||
@@ -28,11 +30,14 @@ export default function CodeViewer({
|
||||
|
||||
return (
|
||||
<div className="flex-1 h-full font-mono text-sm">
|
||||
<pre ref={codeRef} className="h-full overflow-auto pt-6 pb-6 px-6 line-numbers">
|
||||
<pre
|
||||
ref={codeRef}
|
||||
className="h-full overflow-auto pt-6 pb-6 px-6 line-numbers"
|
||||
>
|
||||
<code className={`${language} whitespace-pre-wrap break-words`}>
|
||||
{paste.content}
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,12 @@ export default function PasswordForm({
|
||||
return (
|
||||
<div className="h-screen w-screen bg-[#0e0f13] flex items-center justify-center text-white">
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
onSubmit={(e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
const pwd = (e.currentTarget as any).password.value;
|
||||
const form = e.currentTarget as HTMLFormElement & {
|
||||
password: { value: string };
|
||||
};
|
||||
const pwd = form.password.value;
|
||||
onSubmit(pwd);
|
||||
}}
|
||||
className="w-full max-w-sm rounded-2xl p-6 space-y-4 backdrop-blur-xl shadow-2xl bg-[linear-gradient(to_bottom_right,rgba(20,24,38,0.9),rgba(14,16,24,0.9))] ring-1 ring-white/10"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
'use client';
|
||||
|
||||
import type { Paste } from "@/types/paste";
|
||||
import { CalendarDays, Copy, Download, Eye, FileText, Plus } from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function PasteSidebar({ paste, id }: { paste: any; id: string }) {
|
||||
export default function PasteSidebar({ paste, id }: { paste: Paste; id: string }) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user