import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Dialog } from '@gravity-ui/uikit';
import { block } from "../../../utils/cn.js";
import { FileDropZone } from "../../molecules/FileDropZone/index.js";
import { FileItem } from "../../molecules/FileItem/index.js";
import { i18n } from "./i18n/index.js";
import "./FileUploadDialog.css";
const b = block('file-upload-dialog');
/**
 * FileUploadDialog presents a drag-and-drop zone and a list of queued files.
 * It is a pure UI component — upload logic is wired externally via `useFileUploadStore`.
 */
export const FileUploadDialog = ({ open, onClose, accept, multiple = true, onAdd, files, onApply, onCancel, title = i18n('title'), dropZoneLabel, dropZoneHint, applyButtonText = i18n('apply-button'), cancelButtonText = i18n('cancel-button'), disabled, }) => {
    return (_jsxs(Dialog, { open: open, onClose: onClose, className: b(), children: [_jsx(Dialog.Header, { caption: title }), _jsxs(Dialog.Body, { className: b('body'), children: [_jsx(FileDropZone, { accept: accept, multiple: multiple, onAdd: onAdd, label: dropZoneLabel, hint: dropZoneHint, disabled: disabled, className: b('drop-zone') }), files.length > 0 && (_jsx("div", { className: b('file-list'), children: files.map((fileProps) => {
                            var _a;
                            return (_jsx(FileItem, Object.assign({}, fileProps), (_a = fileProps.id) !== null && _a !== void 0 ? _a : fileProps.name));
                        }) }))] }), _jsx(Dialog.Footer, { onClickButtonApply: onApply !== null && onApply !== void 0 ? onApply : onClose, onClickButtonCancel: onCancel !== null && onCancel !== void 0 ? onCancel : onClose, textButtonApply: applyButtonText, textButtonCancel: cancelButtonText, propsButtonApply: {
                    disabled: disabled || files.length === 0 || files.some((f) => f.status === 'loading'),
                } })] }));
};
//# sourceMappingURL=FileUploadDialog.js.map
