"use client"; import { Modal } from "@/app/_components/GlobalComponents/UIElements/Modal"; import { Button } from "@/app/_components/GlobalComponents/UIElements/Button"; import { AlertCircle, Copy, X } from "lucide-react"; import { showToast } from "@/app/_components/GlobalComponents/UIElements/Toast"; interface ErrorDetails { title: string; message: string; details?: string; command?: string; output?: string; stderr?: string; timestamp: string; jobId?: string; } interface ErrorDetailsModalProps { isOpen: boolean; onClose: () => void; error: ErrorDetails | null; } export const ErrorDetailsModal = ({ isOpen, onClose, error, }: ErrorDetailsModalProps) => { if (!isOpen || !error) return null; const handleCopyDetails = async () => { const detailsText = ` Error Details: Title: ${error.title} Message: ${error.message} ${error.details ? `Details: ${error.details}` : ""} ${error.command ? `Command: ${error.command}` : ""} ${error.output ? `Output: ${error.output}` : ""} ${error.stderr ? `Stderr: ${error.stderr}` : ""} Timestamp: ${error.timestamp} `.trim(); try { await navigator.clipboard.writeText(detailsText); showToast("success", "Error details copied to clipboard"); } catch (err) { showToast("error", "Failed to copy error details"); } }; return (

{error.title}

{error.message}

{error.details && (

Details

                {error.details}
              
)} {error.command && (

Command

{error.command}
)} {error.output && (

Output

                {error.output}
              
)} {error.stderr && (

Error Output

                {error.stderr}
              
)}
Timestamp: {error.timestamp}
); };