diff options
Diffstat (limited to 'components/notice/notice-view-dialog.tsx')
| -rw-r--r-- | components/notice/notice-view-dialog.tsx | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/components/notice/notice-view-dialog.tsx b/components/notice/notice-view-dialog.tsx new file mode 100644 index 00000000..9b42311a --- /dev/null +++ b/components/notice/notice-view-dialog.tsx @@ -0,0 +1,56 @@ +"use client"
+
+import * as React from "react"
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog"
+import type { Notice } from "@/db/schema/notice"
+
+type NoticeWithAuthor = Notice & {
+ authorName: string | null
+ authorEmail: string | null
+}
+
+interface NoticeViewDialogProps {
+ open: boolean
+ onOpenChange: (open: boolean) => void
+ notice: NoticeWithAuthor | null
+}
+
+export function NoticeViewDialog({
+ open,
+ onOpenChange,
+ notice,
+}: NoticeViewDialogProps) {
+
+ if (!notice) return null
+
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent className="max-w-4xl max-h-[80vh] overflow-y-auto">
+ <DialogHeader>
+ <div className="flex items-start justify-between">
+ <div className="space-y-2 flex-1">
+ <div className="flex items-center gap-2">
+ <DialogTitle className="text-xl font-bold">
+ 제목: {notice.title}
+ </DialogTitle>
+ </div>
+ </div>
+ </div>
+ </DialogHeader>
+
+ <div className="mt-6 rounded-lg border border-gray-200 p-4">
+ <div
+ className="prose prose-sm max-w-none"
+ dangerouslySetInnerHTML={{ __html: notice.content }}
+ />
+ </div>
+ </DialogContent>
+
+ </Dialog>
+ )
+}
\ No newline at end of file |
