Sindbad~EG File Manager

Current Path : /home/infinitibizsol/public_html/auction-sync.com/static/js/
Upload File :
Current File : /home/infinitibizsol/public_html/auction-sync.com/static/js/474.1737febb.chunk.js

"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[474],{474:(e,t,n)=>{n.r(t),n.d(t,{default:()=>k});var i=n(2791),o=(n(3609),n(1614)),a=n(3767),l=n(890),d=n(1889),s=n(7621),r=n(3400),c=n(4518),u=n(1209),m=n(4554),v=n(7391),h=n(7689),x=n(9434),p=n(9113),f=n(5985),b=n(9709),g=n(6189),j=n(184);const Z=(0,g.Z)((0,j.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),y=(0,g.Z)((0,j.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),_={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",boxShadow:24,p:4},w=e=>{const{open:t,handleClose:n,onConfirmation:i,message:o}=e;return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(u.Z,{open:t,onClose:n,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,j.jsxs)(m.Z,{sx:_,children:[(0,j.jsx)(l.Z,{id:"modal-modal-title",variant:"h6",component:"h2",sx:{mb:1,textAlign:"center"},children:o||"Are you sure you want to do this Action?"}),(0,j.jsxs)(a.Z,{spacing:2,direction:"row",justifyContent:"center",alignItems:"flex-end",sx:{mt:2},children:[(0,j.jsxs)(c.Z,{variant:"contained",style:{width:"150px",backgroundColor:"#4CAF50",borderRadius:"30px",color:"white",marginRight:"8px",fontWeight:"bold"},onClick:()=>{i()},children:["Yes"," "]}),(0,j.jsxs)(c.Z,{variant:"contained",style:{width:"150px",backgroundColor:"#E53935",borderRadius:"30px",color:"white",fontWeight:"bold"},onClick:n,children:["No"," "]})]})]})})})};var A=n(3240);const C={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",border:"2px solid #000",boxShadow:24,p:4};function k(){(0,h.s0)(),(0,x.I0)();const{userInfo:e}=(0,x.v9)((e=>e.auth)),[t,n]=(0,i.useState)(!1),[g,_]=(0,i.useState)({open:!1,id:null}),[k,F]=(0,i.useState)({state:!1,id:null}),[S,E]=(0,i.useState)([]),[I,N]=(0,i.useState)([]),[z,L]=(0,i.useState)(!1),[P,R]=(0,i.useState)({default_amount:"",name:""});(0,i.useEffect)((()=>{D(),M()}),[]);const D=async()=>{try{const n=await A.Z.post("".concat(p.v,"/auctioneer-fees/get-auctioneer-fees/").concat(null===e||void 0===e?void 0:e.user_id));if(200==(null===n||void 0===n?void 0:n.status)){var t;let e=null===n||void 0===n||null===(t=n.data)||void 0===t?void 0:t.data;E(e)}}catch(n){f.Am.error("Error While fetching Auctioneer Fee List.")}},M=async t=>{try{const t=await A.Z.post("".concat(p.v,"/auctions-lanes/auctioneer-lanes"),{auctioneer_id:null===e||void 0===e?void 0:e.user_id});if(200==(null===t||void 0===t?void 0:t.status)){var n;let e=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.data;N(e)}}catch(i){f.Am.error("Error While fetching Auction Lanes.")}},U=(e,t)=>{R((n=>({...n,[e]:t})))};return(0,j.jsxs)(o.Z,{sx:{maxHeight:"60vh"},children:[(0,j.jsx)(a.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:2,children:(0,j.jsx)(l.Z,{variant:"h4",children:"AUCTIONEER LANES"})}),(0,j.jsx)(d.ZP,{container:!0,spacing:3,mb:5,children:!(null!==I&&void 0!==I&&I.length)>0?(0,j.jsx)(d.ZP,{item:!0,xs:12,sm:6,md:4,children:"You have no Lanes yet!"}):null===I||void 0===I?void 0:I.map((e=>{var t;return(0,j.jsx)(d.ZP,{item:!0,xs:12,sm:6,children:(0,j.jsxs)(s.Z,{sx:{py:5,boxShadow:0,textAlign:"center",cursor:"pointer"},children:[(0,j.jsxs)(l.Z,{variant:"subtitle1",children:["Auction Name: ",(0,j.jsx)("strong",{children:null===e||void 0===e?void 0:e.auction_name})]}),null===e||void 0===e||null===(t=e.lane_names)||void 0===t?void 0:t.map((e=>(0,j.jsxs)(l.Z,{variant:"subtitle2",children:["Lane Name: ",(0,j.jsx)("strong",{children:null===e||void 0===e?void 0:e.name})]})))]})})}))}),(0,j.jsx)(a.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:2,children:(0,j.jsx)(l.Z,{variant:"h4",children:"AUCTIONEER FEE"})}),(0,j.jsx)(d.ZP,{container:!0,spacing:3,mb:3,children:!(null!==S&&void 0!==S&&S.length)>0?"You have no fees yet!":null===S||void 0===S?void 0:S.map((e=>(0,j.jsx)(d.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,j.jsxs)(s.Z,{sx:{py:5,boxShadow:0,textAlign:"center",cursor:"pointer",position:"relative"},children:[(0,j.jsx)(r.Z,{sx:{position:"absolute",top:"5px",right:"5px",zIndex:1},"aria-label":"edit",onClick:()=>(async e=>{R({default_amount:null===e||void 0===e?void 0:e.fee_amount,name:null===e||void 0===e?void 0:e.name}),F({state:!0,id:null===e||void 0===e?void 0:e.auctioneer_fee_id}),n(!0)})(e),children:(0,j.jsx)(Z,{sx:{fontSize:"1.2rem"}})}),(0,j.jsxs)(l.Z,{variant:"subtitle2",children:["Fees Name: ",(0,j.jsx)("strong",{children:null===e||void 0===e?void 0:e.name})]}),(0,j.jsxs)(l.Z,{variant:"subtitle2",children:["Fees Amount: ",(0,j.jsxs)("strong",{children:["$ ",null===e||void 0===e?void 0:e.fee_amount]})]}),(0,j.jsx)(r.Z,{sx:{position:"absolute",bottom:"5px",right:"5px",zIndex:1,color:"red"},"aria-label":"delete",onClick:()=>_({open:!0,id:null===e||void 0===e?void 0:e.auctioneer_fee_id}),children:(0,j.jsx)(y,{sx:{fontSize:"1.2rem"}})})]})})))}),(0,j.jsx)(d.ZP,{item:!0,style:{textAlign:"center"},children:(0,j.jsxs)(c.Z,{variant:"contained",style:{textAlign:"center"},color:"primary",onClick:()=>n(!0),children:["Add New Fee"," "]})}),(0,j.jsx)(w,{open:null===g||void 0===g?void 0:g.open,handleClose:()=>_({open:!1,id:null}),onConfirmation:async()=>{if(null!==g&&void 0!==g&&g.id)try{const e=await A.Z.delete("".concat(p.v,"/auctioneer-fees/remove-fee/").concat(null===g||void 0===g?void 0:g.id));200===(null===e||void 0===e?void 0:e.status)&&(f.Am.success("Fee Deleted Successfully!"),D())}catch(e){console.log("Error",e),f.Am.error("Error while deleting Fee")}_({open:!1,id:null})},message:"Are you sure you want to delete this Fee?"}),(0,j.jsx)(u.Z,{open:t,onClose:()=>{n(!1),F({state:!1,id:null}),R({default_amount:"",name:""})},"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,j.jsxs)(m.Z,{sx:C,children:[(0,j.jsxs)(l.Z,{id:"modal-modal-title",variant:"h6",component:"h2",children:[null!==k&&void 0!==k&&k.state?"Update":"Add"," Fee"]}),(0,j.jsxs)(m.Z,{component:"form",sx:{"& > :not(style)":{my:1,width:"100%"}},noValidate:!0,autoComplete:"off",children:[(0,j.jsx)(v.Z,{required:!0,id:"name",label:"Fee Name",variant:"filled",sx:{width:"100%"},onChange:e=>U("name",e.target.value),value:P.name}),(0,j.jsx)(v.Z,{required:!0,type:"number",id:"amount",label:"Fee Amount",variant:"filled",onChange:e=>U("default_amount",e.target.value),value:P.default_amount}),null!==k&&void 0!==k&&k.state?(0,j.jsx)(b.Z,{loading:z,variant:"contained",type:"submit",onClick:async t=>{if(t.preventDefault(),P.name&&P.default_amount&&null!==k&&void 0!==k&&k.id){L(!0);try{const t=await A.Z.post("".concat(p.v,"/auctioneer-fees/edit-fee"),{name:P.name,fee_amount:P.default_amount,auctioneer_fee_id:null===k||void 0===k?void 0:k.id,auctioneer_id:null===e||void 0===e?void 0:e.user_id});200===(null===t||void 0===t?void 0:t.status)&&f.Am.success("Fee (".concat(null===P||void 0===P?void 0:P.name,") Updated Successfully!"))}catch(i){f.Am.error("Error while updating Fee!"),console.log(i)}L(!1),n(!1),R({default_amount:"",name:""}),F({state:!1,id:null}),D()}},children:"update"}):(0,j.jsx)(b.Z,{loading:z,type:"submit",variant:"contained",onClick:async t=>{if(t.preventDefault(),P.name&&P.default_amount){L(!0);try{const t=await A.Z.post("".concat(p.v,"/auctioneer-fees/add-fee"),{...P,auctioneer_id:null===e||void 0===e?void 0:e.user_id});200===(null===t||void 0===t?void 0:t.status)&&f.Am.success("Fee (".concat(null===P||void 0===P?void 0:P.name,") Added Successfully!"))}catch(i){f.Am.error("Error while adding Fee!"),console.log(i)}L(!1),n(!1),R({default_amount:"",name:""}),D()}},children:"Add"})]})]})})]})}}}]);
//# sourceMappingURL=474.1737febb.chunk.js.map

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists