From 4abb9cb689b82a87b55ccc02c127abb684783300 Mon Sep 17 00:00:00 2001 From: Ryan Freeman Date: Wed, 14 May 2025 21:20:14 +0100 Subject: [PATCH] Update comment component --- components/ui/Code.tsx | 7 +- components/ui/Comments.tsx | 123 +++++++++++++++++--------------- components/ui/StatusMessage.tsx | 2 +- lib/comments.ts | 9 +++ next.config.mjs | 6 +- 5 files changed, 79 insertions(+), 68 deletions(-) create mode 100644 lib/comments.ts diff --git a/components/ui/Code.tsx b/components/ui/Code.tsx index d17060b..47624dd 100644 --- a/components/ui/Code.tsx +++ b/components/ui/Code.tsx @@ -8,22 +8,19 @@ import clsx from 'clsx' export function Code({children}: { children: ReactNode }) { const [copied, setCopied] = useState(false) const preRef = useRef(null) - const buttonRef = useRef(null) const handleCopy = async (e: React.MouseEvent) => { e.preventDefault() await navigator.clipboard.writeText(preRef.current?.innerText ?? '') setCopied(true) setTimeout(() => setCopied(false), 1000) - buttonRef.current?.blur() } return (
                 
-                 :
-                
-
- {session?.user?.image !== null && - {session?.user?.name - } -
+ +
+ {session && + {session?.user?.name + } +