{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "file-list",
  "type": "registry:ui",
  "title": "File list",
  "description": "A stacked list of file rows showing each name and metadata such as size or date, with an optional download button per item. Good for React attachment lists.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.minidev.pro/r/file-row.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/file-list.tsx",
      "type": "registry:ui",
      "target": "components/ui/file-list.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { FileRow } from \"@/components/ui/file-row\"\n\n/** A stack of file rows with name, metadata and an optional download action. */\ntype FileItem = { id: string; name: string; meta?: string }\n\nconst SAMPLE_FILES: FileItem[] = [\n  { id: \"f1\", name: \"INV-2041-northwind.pdf\", meta: \"PDF · 184 KB · Sep 24, 2026\" },\n  { id: \"f2\", name: \"Q3-revenue-report.xlsx\", meta: \"Spreadsheet · 1.2 MB · Oct 2, 2026\" },\n  { id: \"f3\", name: \"northwind-msa-signed.pdf\", meta: \"PDF · 2.8 MB · Aug 11, 2026\" },\n  { id: \"f4\", name: \"payouts-september.csv\", meta: \"CSV · 96 KB · Oct 1, 2026\" },\n  { id: \"f5\", name: \"lumen-brand-assets.zip\", meta: \"Archive · 14.6 MB · Jul 30, 2026\" },\n]\n\ntype FileListProps = {\n  /** Files to list. Defaults to a few Lumen documents. */\n  files?: FileItem[]\n  /** Called with the file id. When present, each row shows a download button (the sample files show one regardless). */\n  onDownload?: (id: string) => void\n  className?: string\n}\n\nfunction FileList({\n  files = SAMPLE_FILES,\n  onDownload,\n  className,\n}: FileListProps) {\n  const download = onDownload ?? (files === SAMPLE_FILES ? () => {} : undefined)\n  return (\n    <div data-slot=\"file-list\" className={cn(\"space-y-2\", className)}>\n      {files.map((f) => (\n        <FileRow key={f.id} name={f.name} meta={f.meta} onDownload={download ? () => download(f.id) : undefined} />\n      ))}\n    </div>\n  )\n}\nexport { FileList }\nexport type { FileListProps, FileItem }\n"
    }
  ]
}
