import{__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as s,jsx as c,Fragment as i}from"react/jsx-runtime";import n from"classnames";import{LinearProgress as e}from"@material-ui/core";import{FileIcon as r}from"../FileIcon/FileIcon.js";import t from"../IconButton/index.js";import{CloseIcon as m,DeleteFourIcon as l,RedoIcon as a}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import{CautionFilledCustomIcon as p}from"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import{MiddleTruncatedText as d}from"../MiddleTruncatedText/MiddleTruncatedText.js";import{Regular14 as u,Regular12 as j}from"../Typography.js";import{formatSizeProgress as I}from"./utils.js";import{useStyles as h}from"./styles.js";var C=function(C){var f=C.formatProgress,x=void 0===f?I:f,k=C.className,v=C.name,F=C.current,N=C.total,T=C.errorText,b=C.onCancel,g=C.onReload,M=C.onDelete,R=h(),P=N>=0&&F>=0,z=Math.min(100,Math.ceil(F/N*100)),y=F>=N;return s("div",o({className:n(R.root,k)},{children:[c(r,{name:v,className:R.icon,strokeWidth:2}),s("div",o({className:R.content},{children:[c(u,o({className:R.name},{children:c(d,{children:v},v)})),!T&&!y&&s(i,{children:[c(e,{className:R.progressBar,variant:P?"determinate":void 0,value:z}),s("div",o({className:R.progressTextContainer},{children:[c(j,o({className:R.progressText},{children:x(N,F)})),P&&s(j,o({className:R.progressText},{children:[z,"%"]}))]}))]}),T&&s(u,o({className:R.error},{children:[c(p,{size:16}),T]}))]})),b&&!T&&!y&&c(t,o({onClick:b,size:"small",tooltipProps:{title:"Cancel"}},{children:c(m,{})})),M&&(T||y)&&c(t,o({onClick:M,size:"small",tooltipProps:{title:"Remove File"}},{children:c(l,{})})),g&&T&&c(t,o({onClick:g,size:"small",tooltipProps:{title:"Reload"}},{children:c(a,{})}))]}))};export{C as FilesLoaderV2};
