From da00bbf203534b2663289d6fe45b6ed8663e7e11 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 23 Sep 2025 02:44:05 +0000
Subject: (최겸) 구매 인포메이션, 공지사항 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/information/information-client.tsx | 36 +++++++++++++++++++--------
 1 file changed, 26 insertions(+), 10 deletions(-)

(limited to 'components/information/information-client.tsx')

diff --git a/components/information/information-client.tsx b/components/information/information-client.tsx
index 48bb683d..53350d13 100644
--- a/components/information/information-client.tsx
+++ b/components/information/information-client.tsx
@@ -28,13 +28,18 @@ import { toast } from "sonner"
 import { formatDate } from "@/lib/utils"
 import { getInformationLists, syncInformationFromMenuAssignments, getInformationDetail } from "@/lib/information/service"
 import type { PageInformation } from "@/db/schema/information"
+
+type PageInformationWithUpdatedBy = PageInformation & {
+  updatedByName?: string | null
+  updatedByEmail?: string | null
+}
 import { UpdateInformationDialog } from "@/lib/information/table/update-information-dialog"
 
 interface InformationClientProps {
   initialData?: PageInformation[]
 }
 
-type SortField = "pageName" | "pagePath" | "createdAt"
+type SortField = "pageName" | "pagePath" | "updatedAt"
 type SortDirection = "asc" | "desc"
 
 export function InformationClient({ initialData = [] }: InformationClientProps) {
@@ -58,12 +63,12 @@ export function InformationClient({ initialData = [] }: InformationClientProps)
     }
   }
   
-  const [informations, setInformations] = useState<PageInformation[]>(initialData)
+  const [informations, setInformations] = useState<PageInformationWithUpdatedBy[]>(initialData)
   const [loading, setLoading] = useState(false)
   const [searchQuery, setSearchQuery] = useState("")
   const [sortField, setSortField] = useState<SortField>("createdAt")
   const [sortDirection, setSortDirection] = useState<SortDirection>("desc")
-  const [editingInformation, setEditingInformation] = useState<PageInformation | null>(null)
+  const [editingInformation, setEditingInformation] = useState<PageInformationWithUpdatedBy | null>(null)
   const [isEditDialogOpen, setIsEditDialogOpen] = useState(false)
   const [isSyncing, setIsSyncing] = useState(false)
   const [, startTransition] = useTransition()
@@ -327,13 +332,14 @@ export function InformationClient({ initialData = [] }: InformationClientProps)
               </TableHead>
               <TableHead>정보 내용</TableHead>
               <TableHead>상태</TableHead>
+              <TableHead>수정자</TableHead>
               <TableHead>
                 <button
                   className="flex items-center gap-1 hover:text-foreground"
-                  onClick={() => handleSort("createdAt")}
+                  onClick={() => handleSort("updatedAt")}
                 >
-                  생성일
-                  {sortField === "createdAt" && (
+                  수정일
+                  {sortField === "updatedAt" && (
                     sortDirection === "asc" ? (
                       <ChevronUp className="h-4 w-4" />
                     ) : (
@@ -342,20 +348,21 @@ export function InformationClient({ initialData = [] }: InformationClientProps)
                   )}
                 </button>
               </TableHead>
+              <TableHead>수정일</TableHead>
               <TableHead className="text-right">작업</TableHead>
             </TableRow>
           </TableHeader>
           <TableBody>
             {loading ? (
               <TableRow>
-                <TableCell colSpan={7} className="text-center py-8">
+                <TableCell colSpan={8} className="text-center py-8">
                   로딩 중...
                 </TableCell>
               </TableRow>
             ) : filteredAndSortedInformations.length === 0 ? (
               <TableRow>
-                <TableCell colSpan={7} className="text-center py-8 text-muted-foreground">
-                  정보가 없습니다.
+                <TableCell colSpan={8} className="text-center py-8 text-muted-foreground">
+                  안내사항이 없습니다.
                 </TableCell>
               </TableRow>
             ) : (
@@ -388,7 +395,16 @@ export function InformationClient({ initialData = [] }: InformationClientProps)
                     </Badge>
                   </TableCell>
                   <TableCell>
-                    {formatDate(information.createdAt, "KR")}
+                    {information.updatedByName || '시스템'}
+                  </TableCell>
+                  <TableCell>
+                    {formatDate(information.updatedAt, "KR")}
+                  </TableCell>
+                  <TableCell>
+                    {information.updatedAt && information.updatedAt !== information.createdAt
+                      ? formatDate(information.updatedAt, "KR")
+                      : '-'
+                    }
                   </TableCell>
                   <TableCell className="text-right">
                     <Button 
-- 
cgit v1.2.3

