From 346b9a2ba09de6b5e44f11242554df1768c3aa80 Mon Sep 17 00:00:00 2001 From: Loong Loong Date: Wed, 8 Oct 2025 17:30:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=E7=89=B9=E5=AE=9A=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=98=A0=E5=B0=84=E6=B7=BB=E5=8A=A0=20docId=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=20GiscusComments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/GiscusComments.tsx | 12 ++++++++---- app/docs/[...slug]/page.tsx | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/components/GiscusComments.tsx b/app/components/GiscusComments.tsx index 5883c78..cfde287 100644 --- a/app/components/GiscusComments.tsx +++ b/app/components/GiscusComments.tsx @@ -1,12 +1,15 @@ -'use client'; +"use client"; -import Giscus from '@giscus/react'; +import Giscus from "@giscus/react"; interface GiscusCommentsProps { className?: string; + docId?: string | null; } -export function GiscusComments({ className }: GiscusCommentsProps) { +export function GiscusComments({ className, docId }: GiscusCommentsProps) { + const useDocId = typeof docId === "string" && docId.trim().length > 0; + return (
- +