From ef4c533ebacc2cdc97e518f30e9a9350004fcdfb Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 28 Apr 2025 02:13:30 +0000
Subject: ~20250428 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/pq/pq-review-table.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'components/pq/pq-review-table.tsx')

diff --git a/components/pq/pq-review-table.tsx b/components/pq/pq-review-table.tsx
index e778cf91..08b4de61 100644
--- a/components/pq/pq-review-table.tsx
+++ b/components/pq/pq-review-table.tsx
@@ -25,6 +25,7 @@ import { addReviewCommentAction, getItemReviewLogsAction } from "@/lib/pq/servic
 import { useToast } from "@/hooks/use-toast"
 import { formatDate } from "@/lib/utils"
 import { downloadFileAction } from "@/lib/downloadFile"
+import { useSession } from "next-auth/react" 
 
 interface ReviewLog {
   id: number
@@ -189,6 +190,9 @@ function ItemReviewButton({ answerId, checkPoint, onCommentAdded }: ItemReviewBu
   const [newComment, setNewComment] = React.useState("");
   const [isLoading, setIsLoading] = React.useState(false);
   const [hasComments, setHasComments] = React.useState(false);
+  const { data: session } = useSession()
+  const reviewerName = session?.user?.name || "Unknown Reviewer"
+  const reviewerId = session?.user?.id
 
   // If there's no answerId, item wasn't answered
   if (!answerId) {
@@ -258,7 +262,7 @@ function ItemReviewButton({ answerId, checkPoint, onCommentAdded }: ItemReviewBu
       const res = await addReviewCommentAction({
         answerId,
         comment: newComment,
-        reviewerName: "AdminUser",
+        reviewerName,
       });
       
       if (res.ok) {
-- 
cgit v1.2.3

