Attachment list
File rows with upload progress, clear failure feedback, and retry or removal actions.
Implementation
1"use client";2 3import { useEffect, useRef, type HTMLAttributes } from "react";4import {5 Download,6 ExternalLink,7 FileImage,8 FileText,9 RotateCcw,10 X,11} from "lucide-react";12 13type AttachmentDetails = {14 id: string;15 name: string;16 /** A human-readable format such as PDF, PNG, or application/pdf. */17 type?: string;18 /** File size in bytes. */19 size?: number;20 /** An application-supplied URL; only ready files expose it. */21 url?: string;22 /** Use the URL as a download, optionally supplying its filename. */23 download?: boolean | string;24 disabled?: boolean;25};26 27export type AttachmentItem = AttachmentDetails &28 (