1"use strict";(self.webpackChunkdropspace_frontend_v3=self.webpackChunkdropspace_frontend_v3||[]).push([["3880"],{11442:function(e,t,s){e.exports=s.p+"static/image/image-placeholder.cd1b5042.png"},11931:function(e,t,s){s.r(t),s.d(t,{default:()=>b});var l=s(74848),a=s(96540),n=s(43601),i=s(91567),c=s(27639),r=s(35871),o=s(19990),d=s(82949),m=s(10121),x=s(76317),u=s(47767),p=s(84976),A=s(11442),h=s(94348),f=s(12377),g=s(17719);s(49285);let j=e=>{let{item:t,className:s}=e,n=(0,u.Zp)(),[i,c]=(0,a.useState)(!1),[o,d]=(0,a.useState)(!1),[m,x]=(0,a.useState)(!1),[j,b]=(0,a.useState)("");return(0,a.useEffect)(()=>{m&&("edit"==j?n(`/edit-collection/${t.project_id}?step=2`):"delete"==j&&c(!0),b(""))},[j,n,m,t.project_id]),(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:`collection relative ${s||""}`,children:[(0,l.jsx)("div",{className:"image-container",children:(0,l.jsx)(p.N_,{to:"1"!=e.item.status?`/edit-collection/${e.item.project_id}`:`/collection/${e.item.name_uid}`,children:(0,l.jsx)("img",{src:t.files[3]?r.A.getFileUrl(t.files[3]):A})})}),(0,l.jsxs)("div",{className:"summary",children:[(0,l.jsx)("div",{className:"name",children:(0,l.jsx)(p.N_,{target:"_blank",title:t.name,to:`/collection/${e.item.name_uid}`,children:(0,l.jsx)("span",{children:t.name})})}),(0,l.jsx)("div",{className:"date",children:(0,l.jsx)("span",{children:t.sale_date?(0,g.bR)(t.sale_date):"To be announced"})}),(0,l.jsxs)("div",{className:"values",children:[(0,l.jsx)("span",{className:"price",children:t.mint_price>0||t.mint_price<=0?(0,g.nf)(t.mint_price>0?t.mint_price:0,10)+f.A.getProjectCurrencySymbol(t.chain_id):"TBA"}),(0,l.jsxs)("span",{children:[(0,g.lo)(t.total_count)," Total"]})]})]}),(0,l.jsxs)("div",{className:"absolute flex w-full top-4 px-4 items-top justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-col justify-start gap-y-2",children:["0"==t.status&&(0,l.jsx)("div",{className:"text-black bg-white p-2 text-3 leading-3 font-inter font-bold w-fit",children:"DRAFT"}),"0"!=t.status&&!t.sc_owner&&(0,l.jsx)("div",{className:"text-blue1 bg-white p-2 text-3 leading-3 font-inter font-bold w-fit",children:"UPCOMING"})]}),(0,l.jsx)("div",{className:"",children:(0,l.jsx)("button",{className:"p-[6px] bg-white rounded-full cursor-pointer",onClick:e=>{d(e=>!e)},onBlur:async e=>{x(!1),await (0,g.yy)(200),x(!0),d(!1)},children:(0,l.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEDSURBVHgB7ZbLDYJAEIZ/HwV49OZ2IB3I0ZslSAl2AJ2AlaAVWIJ2AEdvOhOWZFjRZJc4xoQv+cNMOAzMaxcY+TEThBOT9tY+kY5QJCM9HGVQwvQEb7WAJ1P4Ewk7Ix2Ev4Mnc/hTCztx3t2gRInX9F+giCHlpMqKbe/6jzAzhMMp35KWaBrzDkV4FLn2bQNe0R3Pr7KwAd0pqKDUiLEImlu1vvciCtmEn/6yhgL8AbL+sg/UiNDtgwqBTTjkPsCZWNvnGUrpH2nhtLuHkYEifPS6U1BCiRjd0ZPT4D0JIYvICDsjFcJfQQGu/7tLqYESaU/wFAEMWUQJaWPtAs0yGvk/noDLVmy/ea6RAAAAAElFTkSuQmCC",className:"w-4 h-4"})})})]}),o&&(0,l.jsxs)("div",{className:"absolute flex flex-col gap-y-2 bg-white rounded-sm font-aeonik font-medium text-4 leading-[19.2px] right-4 top-[48px] text-left p-5",children:[(0,l.jsx)("div",{className:"text-black cursor-pointer",onClick:e=>{b("edit")},children:"Edit"}),"0"==t.status&&(0,l.jsx)("div",{className:"text-black cursor-pointer",onClick:e=>{b("delete")},children:"Delete"})]}),i&&(0,l.jsx)(h.A,{title:"Are you sure you want to delete the collection?",clsWrap:"modal-confirm-mainnet",clsTitle:"text-black mt-10 text-left px-10",isOpen:i,onClose:()=>{c(e=>!e)},children:(0,l.jsxs)("div",{className:"flex items-center justify-end gap-x-4 pt-6 px-5 mt-10",children:[(0,l.jsx)("button",{className:"btn rounded-0 text-black border border-black font-inter font-extrabold text-3_5 leading-3_5 py-4 px-5",onClick:()=>{c(!1)},children:"Cancel"}),(0,l.jsx)("button",{className:"btn rounded-0 bg-black text-white font-inter font-extrabold text-3_5 leading-3_5 py-4 px-10 hover:bg-black4 active:bg-black4 focus:bg-black4",onClick:()=>{c(!1),e.onDelete&&e.onDelete(t)},children:"OK"})]})})]})})},b=()=>{let e,t=(0,n.d4)(e=>e.authUser.address),{isAuthenticated:s,requestAuth:u}=(0,m.A)(),[p,A]=(0,a.useState)(12),[h,f]=(0,a.useState)({sortBy:"updated_on",sortDir:"desc",page:1,perPage:p,filters:{onlyCurrentUser:1}}),{items:g,hasMore:b,loading:N,pagination:v,fetchItems:y}=(0,x.Ay)(h,void 0,!0);(0,a.useEffect)(()=>{s&&t&&y(!0)},[s,t,y]);let k=(e=(0,a.useRef)(p),(0,a.useEffect)(()=>{e.current=p}),e.current);(0,a.useEffect)(()=>{k===p||N||f(()=>({sortBy:"updated_on",sortDir:"desc",page:1,perPage:p,filters:{onlyCurrentUser:1}}))},[k,p,N]);let C=async e=>
1{t?s||await u()?r.A.makeRequest("delete",`/projects/collection/${e}`,{project_id:e},void 0,t).then(function(e){e.status=204,d.A.info("Deleted successfully."),y(!0).then(e=>{})}).catch(e=>{let t=r.A.getResponseErrorMsg(e);d.A.info(t||"Error occurred! Please reload a page and try again!")}).finally(()=>{}):d.A.error(o.AI):d.A.error("You need to connect to wallet first!")};return(0,l.jsxs)("div",{className:"page-body my-collections",children:[(0,l.jsx)("div",{className:"container",children:(0,l.jsxs)("div",{className:"title-container",children:[(0,l.jsx)("h1",{className:"title",children:"MY COLLECTIONS"}),(0,l.jsx)("p",{className:"",children:"Manage, share, or simply admire your collections created on dropspace."})]})}),(0,l.jsxs)("div",{className:"container",children:[(0,l.jsx)(c.A,{className:"collections",loading:N,maskCls:"parent",children:s&&g.map((e,t)=>(0,l.jsx)(j,{className:"",item:e,onDelete:async e=>{await C(e.project_id)}},e.project_id))}),b&&(0,l.jsx)("h2",{className:"style-icon mx-auto my-5 md:my-15 text-center",children:(0,l.jsx)(i.A,{className:"btn-normal text-grotesk-t-import text-7_5 bg-white",onClick:()=>{N||f(e=>({...e,page:v.currentPage+1}))},children:N?"Loading...":"View More"})})]})]})}},49285:function(e,t,s){s(74848)}}]);
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.