1"use strict";(self.webpackChunkicongenius=self.webpackChunkicongenius||[]).push([[674],{6098:function(e,t,s){var n=s(4165),r=s(5861),l=s(9439),c=s(2791),a=s(8138),i=s(7721),o=s(1087),d=s(8617),u=s(8125),x=s(3329);t.Z=function(e){var t=e.image.imgId,s=e.image.imgUrl,m=e.image.imgName,h=(0,c.useState)(!0),p=(0,l.Z)(h,2),f=p[0],j=p[1],g=(0,c.useState)(!1),v=(0,l.Z)(g,2),b=v[0],N=v[1],y=function(){var e=(0,r.Z)((0,n.Z)().mark((function e(){var t;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),e.next=3,(0,u.l2)(m);case 3:return t=e.sent,N(!1),"failed"===t.status&&a.Am.push((0,x.jsx)(a.P_,{title:"Error",type:"danger",duration:5e3,children:"Something happened while downloading. Please try again."})),e.abrupt("return");case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,x.jsx)(i.gb,{loading:f,type:"cover",className:"".concat(f&&"sm:h-[185px] sm:w-[185px] h-[200px] w-[200px]"," col-span-1 content-center items-center text-center justify-center flex-1"),customLoader:(0,x.jsx)(a.$j,{color:"slate-200",size:40}),children:(0,x.jsxs)("div",{className:"group flex relative hover:-translate-y-1 shadow-sm hover:shadow-lg rounded transition ease-in-out",children:[(0,x.jsx)(a.zx,{variant:"twoTone",color:"slate-800",loading:b,disabled:b,onClick:function(){y()},className:"".concat(b?"opacity-100":"opacity-0"," group-hover:opacity-100 delay-100 transition-opacity duration-200 shadow-sm absolute border-0 right-0 mt-2 mr-2"),size:"xs",icon:(0,x.jsx)(d.yFZ,{size:16})}),(0,x.jsx)(o.rU,{to:"/image/".concat(t),children:(0,x.jsx)("img",{className:f?"":"object-fit w-full h-full rounded border",src:s,onLoad:function(){return j(!1)},onError:function(){return j(!1)},alt:m})})]})})}},8674:function(e,t,s){s.r(t);var n=s(1413),r=s(4165),l=s(5861),c=s(9439),a=s(2791),i=s(7689),o=s(6098),d=s(8138),u=s(7721),x=s(8125),m=s(8617),h=s(6030),p=s(3329);t.default=function(){var e=(0,i.UO)().collectionId,t=(0,a.useState)([]),s=(0,c.Z)(t,2),f=s[0],j=s[1],g=(0,a.useState)([]),v=(0,c.Z)(g,2),b=v[0],N=v[1],y=(0,a.useState)(!0),w=(0,c.Z)(y,2),k=w[0],Z=w[1],C=(0,a.useState)(!1),S=(0,c.Z)(C,2),z=S[0],O=S[1],I=(0,a.useState)(!1),L=(0,c.Z)(I,2),D=L[0],T=L[1],F=(0,a.useState)(!1),E=(0,c.Z)(F,2),P=E[0],q=E[1],A=(0,h.v9)((function(e){return e.auth.user})),_=(0,i.s0)();(0,a.useEffect)((function(){U()}),[e]);var U=function(){var t=(0,l.Z)((0,r.Z)().mark((function t(){var s,n;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,x.G_)(e);case 2:if("failed"!==(s=t.sent).status){t.next=5;break}return t.abrupt("return",_("/dashboard"));case 5:return j(s.collectionData),t.next=8,(0,x.st)(e);case 8:return n=t.sent,N(n),Z(!1),t.abrupt("return",b);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Y=function(t){O(!0),setTimeout((function(){localStorage.removeItem("projectForm");var s=(0,n.Z)((0,n.Z)({},t),{},{collectionId:e});return localStorage.setItem("projectForm",JSON.stringify(s)),_("/create")}),500)},J=function(){T(!0)},R=function(e){T(!1)},X=function(){var t=(0,l.Z)((0,r.Z)().mark((function t(){var s;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return q(!0),t.next=3,(0,x.P4)(e,A.uid).then((function(e){return e.status}));case 3:return s=t.sent,T(!1),q(!1),"failed"===s&&(O(!1),d.Am.push((0,p.jsx)(d.P_,{title:"Error",type:"danger",children:"Something happened while deleting your collection. Please try again."}))),"success"===s&&(d.Am.push((0,p.jsx)(d.P_,{title:"Done",type:"success",duration:2e3,children:"Your collection was succesfully deleted. You'll be redirected in a second."})),setTimeout((function(){return(JSON.parse(localStorage.getItem("projectForm"))||"").collectionId===e&&localStorage.removeItem("projectForm"),_("/dashboard")}),2e3)),t.abrupt("return",s);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),B=!k&&(0,p.jsxs)(d.Vq,{isOpen:D,onClose:R,onRequestClose:R,className:"justify-center text-center p-4 min-h-full flex items-center",closable:!1,contentClassName:"w-full",shouldCloseOnOverlayClick:!1,shouldCloseOnEsc:!1,children:[(0,p.jsxs)("div",{className:"mt-6 mb-8",children:[(0,p.jsxs)("h5",{className:"mb-1",children:["Delete ",(0,p.jsx)("span",{className:"hero-color-text font-bold",children:f.prompt.projectName})," collection?"]}),(0,p.jsx)("p",{children:0===b.length?"This action cannot be undone.":"You will lose all your generated icons. This cannot be undone."})]}),(0,p.jsxs)("div",{className:"text-center flex gap-2",children:[(0,p.jsx)(d.zx,{block:!0,className:"ltr:mr-2 rtl:ml-2",disabled:P,onClick:R,children:"Cancel"}),(0,p.jsx)(d.zx,{block:!0,variant:"solid",color:"red-600",type:"submit",disabled:P,loading:P,onClick:function(){return X()},children:P?"Deleting...":"Delete"})]})]});return(0,p.jsx)(u.W2,{className:"h-full my-8",children:(0,p.jsxs)("div",{className:"w-full max-w-[900px] lg:min-w-[900px] mx-auto text-center",children:[(0,p.jsx)(u.gb,{loading:k,className:"",customLoader:(0,p.jsxs)("div",{className:"flex flex-col gap-4 w-full content-center items-center text-center justify-center",children:[(0,p.jsx)(d.Od,{height:75,width:200}),(0,p.jsx)(d.Od,{height:12,width:200})]}),children:!k&&(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"flex justify-center text-center items-start gap-1 mb-2",children:[(0,p.jsx)("h1",{className:"text-center text-5xl",children:(0,p.jsx)("span",{className:"hero-color-text font-bold",children:f.prompt.projectName})}),(0,p.jsx)(d.Lt,{placement:"top-end",renderTitle:(0,p.jsx)(d.zx,{className:"group",color:"slate-100",size:"xs",variant:"plain",icon:(0,p.jsx)(m.XlX,{size:14,className:"text-slate-400 group-hover:text-slate-700"})}),children:(0,p.jsxs)(d.Lt.Item,{eventKey:"a",onClick:function(){return J()},children:[(0,p.jsx)(m.Bhs,{size:12})," Delete collection"]})})]}),(0,p.jsx)("p",{className:"text-center",children:(0,p.jsx)("span",{className:"text-slate-500 font-semibold",children:f.prompt.logoRequirements})})]})}),(0,p.jsxs)("div",{className:"mt-8 pt-6 text-center md:divide-x sm:divide-x-0 divide-slate-300 flex w-full",children:[(0,p.jsx)("div",{className:"flex-auto",children:(0,p.jsx)(u.gb,{loading:k,className:"",customLoader:(0,p.jsxs)("div",{className:"flex flex-col gap-2 w-full content-center items-center text-center justify-center",children:[(0,p.jsx)(d.Od,{height:8,width:35}),(0,p.jsx)(d.Od,{height:15,width:75})]}),children:!k&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{className:"uppercase tracking-wider text-slate-400 font-bold text-xs",children:"Style"}),(0,p.jsx)("p",{className:"text-slate-700 text-base font-semibold",children:f.prompt.
1iconStyle[0]})]})})}),(0,p.jsx)("div",{className:"flex-auto",children:(0,p.jsx)(u.gb,{loading:k,className:"",customLoader:(0,p.jsxs)("div",{className:"flex flex-col gap-2 w-full content-center items-center text-center justify-center",children:[(0,p.jsx)(d.Od,{height:8,width:35}),(0,p.jsx)(d.Od,{height:15,width:75})]}),children:!k&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("p",{className:"uppercase tracking-wider text-slate-400 font-bold text-xs",children:"Color"}),(0,p.jsxs)("div",{className:"flex items-center text-center justify-center",children:[(0,p.jsx)("div",{className:"mr-1 h-[18px] w-[18px] rounded",style:{backgroundColor:"".concat(f.prompt.primaryColor[0])}}),(0,p.jsx)("p",{className:"text-slate-700 text-base font-semibold",children:f.prompt.primaryColor[0]})]})]})})})]}),(0,p.jsx)(d.Zb,{className:"border-0 mt-6 mb-4",children:(0,p.jsxs)(u.gb,{loading:k,type:"cover",className:"".concat(k&&"min-h-[200px] flex items-center"," "),children:[!k&&b.length>0&&(0,p.jsx)("div",{className:"grid gap-4 lg:grid-cols-4 md:grid-cols-3 grid-cols-2 flex-1",children:b.map((function(e,t){return(0,p.jsx)(o.Z,{image:e},t)}))}),!k&&0===b.length&&(0,p.jsxs)("div",{className:"min-h-[200px] flex flex-col gap-2 w-full content-center items-center text-center justify-center",children:[(0,p.jsx)(d.qE,{shape:"circle",size:"lg",className:"bg-slate-200 text-slate-400",icon:(0,p.jsx)(m.qiA,{})}),(0,p.jsx)("p",{className:"text-slate-400 font-semibold text-sm",children:"No icons in this collection, yet."}),(0,p.jsxs)("div",{className:"flex items-center gap-2 mt-6",children:[(0,p.jsx)(d.zx,{block:!0,variant:"solid",type:"submit",onClick:function(){Y(f.prompt)},disabled:z,loading:z,children:z?"Loading...":"Create icons now"}),(0,p.jsx)(d.zx,{block:!0,variant:"twoTone",color:"red-600",type:"submit",disabled:z,onClick:function(){return J()},children:"Delete"})]})]})]})}),(0,p.jsx)("div",{className:"flex items-center gap-2 mt-4 justify-center",children:(0,p.jsx)(d.zx,{variant:"twoTone",size:"md",onClick:function(){Y(f.prompt)},disabled:z,loading:z,icon:(0,p.jsx)(m.HQD,{}),children:z?"Loading...":"Add icons to collection"})}),!k&&B]})})}}}]); 2//# sourceMappingURL=674.d6c804c2.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.