import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { CheckCircleIcon, AlertCircleIcon, XCircleIcon } from "lucide-react";
import { UploadResultCategory } from "./UploadResultCategory";
/**
 * Displays a summary of upload results with collapsible categories
 *
 * @example
 * <UploadSummary
 *   files={[
 *     { name: "document1.pdf", status: "success" },
 *     { name: "document2.pdf", status: "skipped" }
 *   ]}
 *   location="/reports/2023"
 * />
 */
export function UploadSummary({ files, className = "", location, collection }) {
    // Group files by status
    const successFiles = files.filter(f => f.status === 'success');
    const updatedFiles = files.filter(f => f.status === 'updated');
    const skippedFiles = files.filter(f => f.status === 'skipped');
    const failedFiles = files.filter(f => f.status === 'failed');
    // Calculate counts
    const successCount = successFiles.length;
    const updatedCount = updatedFiles.length;
    const skippedCount = skippedFiles.length;
    const failedCount = failedFiles.length;
    const totalCount = files.length;
    return (_jsxs("div", { className: `flex flex-col py-2 ${className}`, children: [_jsxs("div", { className: "flex items-center mb-4", children: [_jsx("div", { className: "size-8 mr-4 rounded-full bg-success/10 flex items-center justify-center", children: _jsx(CheckCircleIcon, { className: "size-4 text-success" }) }), _jsx("div", { children: _jsxs("p", { className: "text-muted", children: [totalCount, " file", totalCount !== 1 ? "s" : "", " processed", collection ? ` in collection '${collection}'` : "", location ? ` in folder '${location}'` : ""] }) })] }), _jsxs("div", { className: "space-y-3 mt-2", children: [successCount > 0 && (_jsx(UploadResultCategory, { title: "Successfully Uploaded", count: successCount, icon: _jsx(CheckCircleIcon, { className: "h-4 w-4 text-green-500" }), items: successFiles.map(f => f.name) })), updatedCount > 0 && (_jsx(UploadResultCategory, { title: "Successfully Updated", count: updatedCount, icon: _jsx(CheckCircleIcon, { className: "h-4 w-4 text-blue-500" }), items: updatedFiles.map(f => f.name) })), skippedCount > 0 && (_jsx(UploadResultCategory, { title: "Skipped (Already Existed)", count: skippedCount, icon: _jsx(AlertCircleIcon, { className: "h-4 w-4 text-amber-500" }), items: skippedFiles.map(f => f.name) })), failedCount > 0 && (_jsx(UploadResultCategory, { title: "Failed to Upload", count: failedCount, icon: _jsx(XCircleIcon, { className: "h-4 w-4 text-red-500" }), items: failedFiles.map(f => f.name) }))] })] }));
}
//# sourceMappingURL=UploadSummary.js.map