diff options
Diffstat (limited to 'components/notice/notice-client.tsx')
| -rw-r--r-- | components/notice/notice-client.tsx | 47 |
1 files changed, 43 insertions, 4 deletions
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>
@@ -349,6 +356,38 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr </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">
{notice.authorName || "알 수 없음"}
|
