import React from 'react'; import { format } from 'date-fns'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { User, Calendar, CheckCircle, XCircle, AlertTriangle, MessageSquare } from 'lucide-react'; import { AssetRequestWithAvailability } from '@/types/asset-request'; interface ViewDetailsDialogProps { isOpen: boolean; onClose: () => void; request: AssetRequestWithAvailability | null; onApprove?: (request: AssetRequestWithAvailability) => void; onReject?: (request: AssetRequestWithAvailability) => void; onAddComment?: (request: AssetRequestWithAvailability) => void; } const ViewDetailsDialog: React.FC = ({ isOpen, onClose, request, onApprove, onReject, onAddComment, }) => { const handleOverlayClick = (e: React.MouseEvent) => { if (e.target === e.currentTarget) { onClose(); } }; const getAvailabilityBadge = (available: number, requested: number) => { if (available >= requested) { return ( Available ({available}) ); } else if (available > 0) { return ( Partial ({available}/{requested}) ); } else { return ( Unavailable ); } }; if (!isOpen || !request) return null; return (
{/* Overlay */} ); }; export default ViewDetailsDialog;