"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[7910],{17910:function(e,n,a){a.r(n);var t=a(77439),r=a(49058),o=a(57223),s=a(76701),l=a(73130),i=a(46266),c=a(21878),d=a(11927),u=a(4481),f=a(70466),m=a(537),h=a(17398),x=a(47939),Z=a(17072),p=a(64519),b=a(70783),j=a(18054),v={setFileModeEnabled:h.WA,setModalErrorSnackMessage:p.zb},g=(0,m.$j)(null,v);n.default=g((0,u.Z)((function(e){return(0,d.Z)((0,r.Z)((0,r.Z)({},f.ID),f.DF))}))((function(e){var n=e.modalOpen,a=e.folderName,r=e.bucketName,d=e.onClose,u=e.setFileModeEnabled,f=e.setModalErrorSnackMessage,m=e.classes,h=e.existingFiles,p=(0,o.useState)(""),v=(0,t.Z)(p,2),g=v[0],k=v[1],F=(0,o.useState)(!1),C=(0,t.Z)(F,2),E=C[0],M=C[1],P="".concat(r,"/").concat((0,Z.le)(a)),w=function(){var e="";if(""!==a){var n=(0,Z.le)(a);e=n.endsWith("/")?n:"".concat(n,"/")}if(-1===h.findIndex((function(n){return n.name===e+g}))){var t="/buckets/".concat(r,"/browse/").concat((0,Z.ug)("".concat(e).concat(g)),"/");x.Z.push(t),u(!1),d()}else f({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""})};(0,o.useEffect)((function(){var e=!0;0===g.trim().length&&(e=!1),M(e)}),[g]);return(0,j.jsx)(o.Fragment,{children:(0,j.jsx)(s.Z,{modalOpen:n,title:"\u9009\u62e9\u6216\u65b0\u5efa\u8def\u5f84",onClose:d,titleIcon:(0,j.jsx)(b.Z9,{}),children:(0,j.jsxs)(l.ZP,{container:!0,children:[(0,j.jsxs)(l.ZP,{item:!0,xs:12,className:m.formFieldRow,children:["\u5f53\u524d\u8def\u5f84: ",P]}),(0,j.jsx)(l.ZP,{item:!0,xs:12,className:m.formFieldRow,children:(0,j.jsx)(c.Z,{value:g,label:"\u65b0\u6587\u4ef6\u5939\u8def\u5f84",id:"folderPath",name:"folderPath",placeholder:"\u8f93\u5165\u65b0\u6587\u4ef6\u5939\u8def\u5f84",onChange:function(e){k(e.target.value)},onKeyPress:function(e){"Enter"===e.code&&""!==g&&w()},required:!0})}),(0,j.jsxs)(l.ZP,{item:!0,xs:12,className:m.modalButtonBar,children:[(0,j.jsx)(i.Z,{type:"button",color:"primary",variant:"outlined",onClick:function(){k("")},children:"\u6e05\u9664"}),(0,j.jsx)(i.Z,{type:"submit",variant:"contained",color:"primary",disabled:!E,onClick:w,children:"\u521b\u5efa"})]})]})})})})))}}]);
//# sourceMappingURL=7910.fe00b5c8.chunk.js.map