"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const constants_1 = require("../../../constants");
const useLogic = ({ fileId, fileName, fileSize, progress, selfFiles, setErrorStatusFile, }) => {
    const { controller } = selfFiles[fileId] || {};
    const handleAbort = () => {
        controller?.abort();
        setErrorStatusFile(fileId, constants_1.ABORT_ERROR_MESSAGE);
    };
    return {
        abortButtonProps: {
            onClick: handleAbort,
        },
        fileName,
        fileSize,
        progress,
    };
};
exports.useLogic = useLogic;
