File size: 574 Bytes
3201ca6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import React from "react";
import { cn } from "#/utils/utils";
import { FileItem } from "./file-item";
interface FileListProps {
files: string[];
onRemove?: (index: number) => void;
}
export function FileList({ files, onRemove }: FileListProps) {
return (
<div
data-testid="file-list"
className={cn("flex flex-col gap-y-1.5 justify-start")}
>
{files.map((f, index) => (
<FileItem
key={index}
filename={f}
onRemove={onRemove ? () => onRemove?.(index) : undefined}
/>
))}
</div>
);
}
|