"use strict";(self.webpackChunknft_rewards_marketplace=self.webpackChunknft_rewards_marketplace||[]).push([[3717],{73717:(e,o,n)=>{n.r(o),n.d(o,{default:()=>m});var i=n(61889),a=n(72791),t=n(57689),r=n(73747),l=n(77180),d=n(95048),c=n(38798),u=n(58866);var s=n(62228),v=n(15918),_=n(80184);const m=({dataField:e,queryName:o,queryTab:n,searchText:m,darkMode:h,type:x,userId:f,filterStatement:C,isAuction:p,isSearch:g,blockchain:k,order:B})=>{const[b,y]=(0,a.useState)(),[S,w]=(0,a.useState)(!0),[P,A]=(0,a.useState)(!1),[I,j]=(0,a.useState)(0),[Z,E]=(0,a.useState)(!1),q=(0,d.v9)((e=>e.auth.user));(0,a.useEffect)((()=>{y([]),j(0)}),[B,k,o,n,m]);const F=(({queryName:e,queryTab:o,searchText:n,filterStatement:i,blockchain:a,pageIndex:t,order:r})=>{let d={category:e,name:n,start:t*l.un,limit:l.un};return null!==r&&void 0!==r&&r.sortBy&&(d={...d,sort_field:null===r||void 0===r?void 0:r.sortBy,order:null===r||void 0===r?void 0:r.orderBy}),(i&&null!==i&&void 0!==i&&i.blockchain||a)&&(d={...d,blockchain:null!==i&&void 0!==i&&i.blockchain?i.blockchain:a}),i&&null!==i&&void 0!==i&&i.collections&&(d={...d,collection_ids:null===i||void 0===i?void 0:i.collections}),i&&null!==i&&void 0!==i&&i.collection&&(d={...d,collection_id:null===i||void 0===i?void 0:i.collection}),i&&null!==i&&void 0!==i&&i.email&&"created"===o&&(d={...d,creatorEmail:null===i||void 0===i?void 0:i.email}),i&&null!==i&&void 0!==i&&i.email&&"auctionWined"===o&&(d={...d,auction_winnerEmail:null===i||void 0===i?void 0:i.email}),i&&null!==i&&void 0!==i&&i.email&&"owned"===o&&(d={...d,ownerEmail:null===i||void 0===i?void 0:i.email}),i&&null!==i&&void 0!==i&&i.email&&"claimed"===o&&(d={...d,claimerEmail:null===i||void 0===i?void 0:i.email}),i&&null!==i&&void 0!==i&&i.email&&"blockchainOwned"===o&&(d={...d,blockchain_ownerEmail:null===i||void 0===i?void 0:i.email}),d})({queryName:o,queryTab:n,searchText:m,filterStatement:C,blockchain:k,pageIndex:I,order:B,isAuction:p}),{data:M,loading:N,error:T,refetch:H}=(0,v.Zu)("nfts",F);(0,s.b)((()=>{H()})),(0,a.useEffect)((()=>{y([]),j(0),E(!1),H()}),[B,k,o,n,m]),(0,a.useEffect)((()=>{var e;M&&!T&&(console.log(M),w(!1),0===I?y(null===M||void 0===M?void 0:M.nftsSearch):P||(y((e=>[...e,...M.nftsSearch])),A(!0)),(null===M||void 0===M||null===(e=M.nftsSearch)||void 0===e?void 0:e.length)<l.un?E(!1):E(!0))}),[M]);const $=(0,t.s0)();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(u.Z,{isLoading:S,message:"loading",darkMode:h}),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(i.ZP,{container:!0,spacing:{xs:6,md:6},columns:{xs:1,sm:12,md:12},children:b&&0!==b.length?(0,_.jsx)(_.Fragment,{children:b.map((e=>(0,_.jsx)(r.Z,{nft:e,handleDetails:o=>((e,o)=>{var n;const i=parseInt(null===e||void 0===e||null===(n=e.auction_winner)||void 0===n?void 0:n.id)===parseInt(null===q||void 0===q?void 0:q.id)&&e.auction_status===l.wo.AUCTION_FINISHED;null!==o&&void 0!==o&&o.ctrlKey||null!==o&&void 0!==o&&o.metaKey?window.open(`${l._n}explore/${e.collection_id}/${e.token_id}`,"_blank"):$(p||i?`/auction/${e.collection_id}/${e.token_id}`:`/explore/${e.collection_id}/${e.token_id}`)})(e,o),darkMode:h},e.id)))}):null}),Z&&(0,_.jsx)(c.V,{handleShowMore:e=>{j((e=>e+1)),A(!1),E(!1),H()}})]})]})}},38798:(e,o,n)=>{n.d(o,{V:()=>d});var i=n(36314),a=n(20890),t=n(71366),r=n(78357),l=n(80184);const d=({handleShowMore:e})=>(0,l.jsx)(i.Z,{direction:"column",alignItems:"center",justifyContent:"space-between",marginTop:5,children:(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(t.O,{onClick:e,className:r.Z.gradientButton,children:[(0,l.jsx)(a.Z,{component:"span",color:"#ffffff"}),(0,l.jsx)(a.Z,{variant:"body1",component:"span",fontSize:"11px",children:"Load More"})]})})})},78357:(e,o,n)=>{n.d(o,{Z:()=>i});const i={auctionCardPrevHome:"AuctionCardPrev_auctionCardPrevHome__AsrS8",auctionCardButtonHome:"AuctionCardPrev_auctionCardButtonHome__-LhHd",auctionCardPrevGradientBorder:"AuctionCardPrev_auctionCardPrevGradientBorder__DV1ZX",auctionCardInnerBox:"AuctionCardPrev_auctionCardInnerBox__UBPZv",displayImage:"AuctionCardPrev_displayImage__NhLGg",auctionInfoBox:"AuctionCardPrev_auctionInfoBox__V64Np",countDownBoxMobile:"AuctionCardPrev_countDownBoxMobile__qEDjm",dividerStyles:"AuctionCardPrev_dividerStyles__ooL8w",auctionFooterBox:"AuctionCardPrev_auctionFooterBox__mVYrH",avatarBox:"AuctionCardPrev_avatarBox__+plo0",avatarStyle:"AuctionCardPrev_avatarStyle__vZdXx",buttonBox:"AuctionCardPrev_buttonBox__6qQ96",gradientButton:"AuctionCardPrev_gradientButton__35euC"}}}]);
//# sourceMappingURL=3717.8d3993cd.chunk.js.map