"use client"; import { Correspondence } from "@/types/correspondence"; import { StatusBadge } from "@/components/common/status-badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { format } from "date-fns"; import { ArrowLeft, Download, FileText } from "lucide-react"; import Link from "next/link"; import { Separator } from "@/components/ui/separator"; interface CorrespondenceDetailProps { data: Correspondence; } export function CorrespondenceDetail({ data }: CorrespondenceDetailProps) { return (
{/* Header / Actions */}

{data.document_number}

Created on {format(new Date(data.created_at), "dd MMM yyyy HH:mm")}

{/* Workflow Actions Placeholder */} {data.status === "DRAFT" && ( )} {data.status === "IN_REVIEW" && ( <> )}
{/* Main Content */}
{data.subject}

Description

{data.description || "No description provided."}

Attachments

{data.attachments && data.attachments.length > 0 ? (
{data.attachments.map((file: any, index: number) => (
{file.name || `Attachment ${index + 1}`}
))}
) : (

No attachments.

)}
{/* Sidebar Info */}
Information

Importance

{data.importance}

From Organization

{data.from_organization?.org_name}

{data.from_organization?.org_code}

To Organization

{data.to_organization?.org_name}

{data.to_organization?.org_code}

); }