import { AlertCircle } from 'lucide-react'; import { AttachmentPreviewItem } from './AttachmentPreviewItem'; import type { AttachmentPayload } from '@shared/types'; interface AttachmentPreviewListProps { attachments: AttachmentPayload[]; onRemove: (id: string) => void; error?: string | null; /** When true, previews are overlaid with a disabled indicator (recipient doesn't support attachments). */ disabled?: boolean; /** Hint text shown when disabled and attachments are present. */ disabledHint?: string; } export const AttachmentPreviewList = ({ attachments, onRemove, error, disabled, disabledHint, }: AttachmentPreviewListProps): React.JSX.Element | null => { if (attachments.length === 0 && !error) return null; return (
{attachments.length > 0 ? (
{attachments.map((att) => ( ))}
) : null} {disabled && disabledHint && attachments.length > 0 ? (

{disabledHint}

) : null} {error ? (

{error}

) : null}
); };