import { SvgUse } from "@ivtui/base" import type { Meta, StoryObj } from "@storybook/react" import { FileList, FileListAction, FileListActions, FileListContent, FileListDescription, FileListDescriptionSeparator, FileListDescriptionText, FileListHeader, FileListIcon, FileListInfo, FileListItem, FileListName, FileListProgress, FileListSize, } from "./FileUploadList" const meta: Meta = { title: "media-upload/FileUploadList", component: FileList, parameters: { layout: "centered", }, tags: ["autodocs"], } export default meta type Story = StoryObj // Mock file data const mockFiles = [ { name: "presentation.pdf", size: 2048576, // 2MB type: "application/pdf", progress: 100, status: "completed" as const, }, { name: "image.jpg", size: 1024000, // ~1MB type: "image/jpeg", progress: 75, status: "uploading" as const, }, { name: "document.docx", size: 512000, // ~512KB type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", progress: 0, status: "error" as const, }, ] // Basic File List export const Default: Story = { render: () => ( {mockFiles.map(file => ( {file.type.startsWith("image/") ? ( ) : file.type === "application/pdf" ? ( ) : ( )} {file.name} {file.size} {file.status} ))} ), } // Single File Item export const SingleFile: Story = { render: () => ( vacation-photo.jpg {1024 * 1024 * 3} Uploaded ), } // File with Progress export const WithProgress: Story = { render: () => ( presentation-video.mp4 {1024 * 1024 * 25} Uploading... ), } // Multiple Files with Different States export const MultipleStates: Story = { render: () => ( {/* Completed Upload */} report.pdf {1024 * 512} Completed {/* In Progress */} high-res-image.png {1024 * 1024 * 8} Uploading... 67% {/* Error State */} corrupted-file.zip {1024 * 1024} Upload failed ), } // Empty State export const EmptyState: Story = { render: () => (

No files uploaded yet

Your uploaded files will appear here

), } // Compact View export const CompactView: Story = { render: () => ( {mockFiles.slice(0, 2).map(file => ( {file.name} {file.size} {file.progress < 100 && ( )} ))} ), } // With Custom Icons and Actions export const CustomIcons: Story = { render: () => ( database-backup.sql {1024 * 1024 * 45} Backup completed ), }