"use client"; // 개발관리 > 설계변경 리스트 상세 다이얼로그 (read-only). // wace partMngHisDetailPopUp.jsp 1:1 — 모든 필드 disabled. import React, { useEffect, useState } from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { Loader2 } from "lucide-react"; import { toast } from "sonner"; import { devEoHistoryApi, EoHistoryDetail } from "@/lib/api/devEoHistory"; interface Props { open: boolean; onOpenChange: (open: boolean) => void; objid: string | null; } export function PartHisDetailDialog({ open, onOpenChange, objid }: Props) { const [row, setRow] = useState(null); const [loading, setLoading] = useState(false); useEffect(() => { if (!open || !objid) return; let alive = true; setLoading(true); devEoHistoryApi.detail(objid) .then((data) => { if (alive) setRow(data); }) .catch((e: any) => { toast.error(e?.response?.data?.message ?? e?.message ?? "조회 실패"); onOpenChange(false); }) .finally(() => { if (alive) setLoading(false); }); return () => { alive = false; }; }, [open, objid, onOpenChange]); return ( 설계변경 상세 정보 (PART_MNG_HISTORY) {loading || !row ? (
) : (
)}
); } function Section({ title, children }: { title: string; children: React.ReactNode }) { return (
{title}
{children}
); } function Row({ children }: { children: React.ReactNode }) { return
{children}
; } function V({ label, value, align }: { label: string; value: any; align?: "left" | "center" | "right" }) { const cls = align === "right" ? "text-right" : align === "center" ? "text-center" : ""; return (
{label && }
{value != null && value !== "" ? value : }
); }