summaryrefslogtreecommitdiff
path: root/lib/swp/table/swp-note-dialog.tsx
blob: c8372d68c6588b92e0fad1ea85140bad812f7a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"use client";

import React from "react";
import {
  Dialog,
  DialogContent,
  DialogHeader,
  DialogTitle,
} from "@/components/ui/dialog";
import { ScrollArea } from "@/components/ui/scroll-area";

interface SwpNoteDialogProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  title: string;
  content: string | null;
}

/**
 * SWP Note Full Content Dialog
 * Displays the full content of DC Note (NOTE1) or Eng Note (NOTE2).
 */
export function SwpNoteDialog({
  open,
  onOpenChange,
  title,
  content,
}: SwpNoteDialogProps) {
  return (
    <Dialog open={open} onOpenChange={onOpenChange}>
      <DialogContent className="max-w-2xl max-h-[80vh]">
        <DialogHeader>
          <DialogTitle>{title}</DialogTitle>
        </DialogHeader>
        <ScrollArea className="max-h-[60vh] pr-4">
          <div className="whitespace-pre-wrap text-sm">
            {content || <span className="text-muted-foreground">No content.</span>}
          </div>
        </ScrollArea>
      </DialogContent>
    </Dialog>
  );
}