From 9f761849c2e98f650d089d00aed9df090497ada9 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 27 Oct 2025 03:12:26 +0000
Subject: (최겸) 공지사항 팝업기능 및 다시보지않기 기능 구현(로컬 스토리지
 활용)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/notice/notice-client.tsx | 47 +++++++++++++++++++++++++++++++++----
 1 file changed, 43 insertions(+), 4 deletions(-)

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

diff --git a/components/notice/notice-client.tsx b/components/notice/notice-client.tsx
index 1eb6d75f..ae8ccebc 100644
--- a/components/notice/notice-client.tsx
+++ b/components/notice/notice-client.tsx
@@ -46,6 +46,7 @@ import { NoticeViewDialog } from "./notice-view-dialog"
 type NoticeWithAuthor = Notice & {
   authorName: string | null
   authorEmail: string | null
+  isPopup?: boolean
 }
 
 interface NoticeClientProps {
@@ -150,10 +151,13 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr
     // 검색 필터
     if (searchQuery.trim()) {
       const query = searchQuery.toLowerCase()
-      filtered = filtered.filter(notice => 
+      filtered = filtered.filter(notice =>
         notice.title.toLowerCase().includes(query) ||
         notice.pagePath.toLowerCase().includes(query) ||
-        notice.content.toLowerCase().includes(query)
+        notice.content.toLowerCase().includes(query) ||
+        (notice.authorName && notice.authorName.toLowerCase().includes(query)) ||
+        (notice.isPopup !== undefined && notice.isPopup ? '팝업' : '일반').toLowerCase().includes(query) ||
+        (notice.dontShowDuration && notice.dontShowDuration.toLowerCase().includes(query))
       )
     }
 
@@ -291,6 +295,9 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr
                   )}
                 </button>
               </TableHead>
+              <TableHead>팝업</TableHead>
+              <TableHead>게시기간</TableHead>
+              {/* <TableHead>다시보지않기</TableHead> */}
               <TableHead>작성자</TableHead>
               <TableHead>상태</TableHead>
               <TableHead>
@@ -314,13 +321,13 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr
           <TableBody>
             {loading ? (
               <TableRow>
-                <TableCell colSpan={6} className="text-center py-8">
+                <TableCell colSpan={9} className="text-center py-8">
                   로딩 중...
                 </TableCell>
               </TableRow>
             ) : filteredAndSortedNotices.length === 0 ? (
               <TableRow>
-                <TableCell colSpan={6} className="text-center py-8 text-gray-500">
+                <TableCell colSpan={9} className="text-center py-8 text-gray-500">
                   {searchQuery.trim() ? "검색 결과가 없습니다." : "공지사항이 없습니다."}
                 </TableCell>
               </TableRow>
@@ -348,6 +355,38 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr
                       </div>
                     </div>
                   </TableCell>
+                  <TableCell>
+                    <Badge variant={notice.isPopup ? "default" : "secondary"}>
+                      {notice.isPopup ? "팝업" : "일반"}
+                    </Badge>
+                  </TableCell>
+                  <TableCell>
+                    <div className="text-sm">
+                      {notice.startAt && notice.endAt ? (
+                        <div className="space-y-1">
+                          <div className="text-xs text-muted-foreground">
+                            시작: {formatDate(notice.startAt, "KR")}
+                          </div>
+                          <div className="text-xs text-muted-foreground">
+                            종료: {formatDate(notice.endAt, "KR")}
+                          </div>
+                        </div>
+                      ) : (
+                        <span className="text-xs text-muted-foreground">-</span>
+                      )}
+                    </div>
+                  </TableCell>
+                  {/* <TableCell>
+                    <div className="text-sm">
+                      {notice.dontShowDuration ? (
+                        <Badge variant="outline">
+                          {notice.dontShowDuration === 'day' ? '하루' : '영구'}
+                        </Badge>
+                      ) : (
+                        <span className="text-xs text-muted-foreground">-</span>
+                      )}
+                    </div>
+                  </TableCell> */}
                   <TableCell>
                     <div className="flex flex-col">
                       <span className="font-medium text-sm">
-- 
cgit v1.2.3

