import React, { useContext } from 'react';
import { useStyles } from '../../lib/renderEnvironment/index.js';
import { useResponsiveLayout } from '../ResponsiveLayout/index.js';
import { ThemeContext } from '../../lib/theming/ThemeContext.js';
import { LoadingIcon } from '../../internal/icons2022/LoadingIcon.js';
import { FileUploaderFileStatus } from './fileUtils.js';
import { getJsRowStyles, getJsTileStyles } from './FileUploaderFile.styles.js';
import { DeleteIcon } from './icons/DeleteIcon.js';
export var FileUploaderFileStatusIcon = function (_a) {
    var hovered = _a.hovered, isTileView = _a.isTileView, disabled = _a.disabled, focusedByTab = _a.focusedByTab, isInvalid = _a.isInvalid, status = _a.status, size = _a.size, hasValidation = _a.hasValidation;
    var isMobile = useResponsiveLayout().isMobile;
    var theme = useContext(ThemeContext);
    var jsTileStyles = useStyles(getJsTileStyles);
    var jsRowStyles = useStyles(getJsRowStyles);
    var iconClassNames = isTileView ? jsTileStyles.iconColor(theme) : jsRowStyles.iconColor(theme);
    var iconDelete = React.createElement(DeleteIcon, { size: size, className: iconClassNames });
    if (status === FileUploaderFileStatus.Loading) {
        return hovered || isTileView ? iconDelete : React.createElement(LoadingIcon, { size: size });
    }
    if (disabled || (!isMobile && !hovered && !focusedByTab)) {
        return null;
    }
    if (isInvalid || hasValidation) {
        return iconDelete;
    }
    // TODO - IF-2270 - добавить логику для действий по наведению и клику, пока только удаление
    return iconDelete;
};
//# sourceMappingURL=FileUploaderFileStatusIcon.js.map