/
home
/
infinitibizsol
/
.trash
/
static.1
/
js
/
File Upload :
llllll
Current File: /home/infinitibizsol/.trash/static.1/js/820.94431d45.chunk.js
"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[820],{6657:(e,t,o)=>{o(579);o(5869);o(5043)},7550:(e,t,o)=>{o(5043);var n=o(4535),i=o(310),r=o(6446);(0,n.Ay)(r.A)((e=>{let{theme:t,ownerState:o}=e;const n="light"===t.palette.mode,r="filled"===o.variant,l="outlined"===o.variant,a="soft"===o.variant,c={..."default"===o.color&&{...l&&{backgroundColor:"transparent",color:t.palette.text.primary,border:"1px solid ".concat((0,i.X4)(t.palette.grey[500],.32))},...a&&{color:n?t.palette.text.primary:t.palette.common.white,backgroundColor:(0,i.X4)(t.palette.grey[500],.16)}}},s={..."default"!==o.color&&{...r&&{color:t.palette[o.color].contrastText,backgroundColor:t.palette[o.color].main},...l&&{backgroundColor:"transparent",color:t.palette[o.color].main,border:"1px solid ".concat(t.palette[o.color].main)},...a&&{color:t.palette[o.color][n?"dark":"light"],backgroundColor:(0,i.X4)(t.palette[o.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"capitalize",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...s,...c}}));o(579)},3820:(e,t,o)=>{o.r(t),o.d(t,{default:()=>W});var n=o(5043),i=o(9252),r=o(8911),l=o(5865),a=o(8977),c=o(688),s=o(2143),d=o(5869),u=o(9456),h=(o(9907),o(3536),o(579));var p=o(3216),m=o(8903),x=o(1551),g=o(5660),v=o(6187),b=o(8534),y=o(4535),A=o(2041),j=o(6446),f=o(8446),w=(o(3338),o(7550),o(6657),o(9588)),k=o(3568),C=o(7154),_=o(7858),S=o(1036);const I=(0,y.Ay)("img")({top:0,width:"100%",height:"80%",objectFit:"contain",position:"absolute"}),R=(0,y.Ay)("img")({top:"100%",right:0,transform:"translate(0%, -100%)",width:"100%",height:"50%",objectFit:"contain",position:"absolute"}),D=(0,x.A)({root:{minWidth:400,height:150}}),F={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:360,bgcolor:"background.paper",border:"2px solid #1976D2",borderRadius:2,boxShadow:24,p:4};function B(e){let{product:t,onNavigate:o,onEditNavigate:i,onDeleteNavigate:l}=e;(0,p.Zp)();const{make:a,mileage:c,model:s,color:d,color_name:x,year:y,sold_price:B,imageUrl:N,sale_status:z,auction_name:E,lane_name:W,vin:M,announcements:T,auction_fee:O,run_no:V,condition_light:Y,vehicle_id:L}=t;console.log({product:t});const X=D(),[Z,H]=(0,n.useState)(!1),J=()=>H(!1),U=(0,u.wA)(),{userInfo:q}=(0,u.d4)((e=>e.auth));return(0,h.jsxs)(g.A,{className:X.root,children:[(0,h.jsx)(A.A,{open:Z,onClose:J,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,h.jsxs)(j.A,{sx:F,children:[(0,h.jsx)(v.A,{id:"modal-modal-title",variant:"h6",component:"h2",sx:{color:"#1976D2",mb:1,textAlign:"center"},children:"Are you sure you want to delete"}),(0,h.jsx)(v.A,{id:"modal-modal-description",variant:"h6",component:"h2",align:"center",children:"this vehicle?"}),(0,h.jsxs)(r.A,{spacing:2,direction:"row",justifyContent:"center",alignItems:"flex-end",sx:{mt:2},children:[(0,h.jsx)(b.A,{variant:"contained",style:{width:"150px",backgroundColor:"#E53935",borderRadius:"30px",color:"white",marginRight:"8px",fontWeight:"bold"},onClick:()=>{(async()=>{try{const e=await C.A.delete("".concat(w.VY,"/vehicle/delete-inventory-vehicle/").concat(null===t||void 0===t?void 0:t.vehicle_id));console.log("Vehicle deleted",e),200===e.status?(S.oR.error("Vehicle deleted successfully"),H(!1),U((0,_.M)({timeRange:"currentweek",orderDirection:"ASC",sortBy:"",userId:null===q||void 0===q?void 0:q.user_id}))):console.log("Failed to delete vehicle. Status: ".concat(e.status))}catch(e){console.error("Error deleting vehicle",e)}})()},children:"Yes"}),(0,h.jsx)(b.A,{variant:"contained",style:{width:"150px",backgroundColor:"#4CAF50",borderRadius:"30px",color:"white",fontWeight:"bold"},onClick:J,children:"No"})]})]})}),(0,h.jsxs)(m.Ay,{container:!0,sx:{cursor:"pointer"},children:[(0,h.jsx)(m.Ay,{item:!0,xs:4,sm:4,children:(0,h.jsx)(j.A,{sx:{pt:"50%",position:"relative",cursor:"pointer"},onClick:()=>o(),children:(0,h.jsx)(I,{alt:a,src:"".concat(w.Jz,"/").concat(N)})})}),(0,h.jsx)(m.Ay,{item:!0,xs:6,sm:6,children:(0,h.jsxs)(r.A,{spacing:4,p:3,children:[(0,h.jsx)(r.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:(0,h.jsx)(f.A,{color:"inherit",underline:"hover",children:(0,h.jsx)(j.A,{sx:{fontWeight:"bold",fontSize:"25px"},children:"".concat(y," ").concat(a," ").concat(s)})})}),(0,h.jsxs)(r.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,h.jsx)(v.A,{variant:"subtitle4",noWrap:!0,children:M}),(0,h.jsx)(j.A,{sx:{marginRight:"50px"},children:(0,h.jsx)(v.A,{variant:"subtitle4",noWrap:!0,children:c?"".concat(c," mi."):""})})]})]})}),(0,h.jsx)(m.Ay,{item:!0,xs:2,sm:2,children:(0,h.jsx)(j.A,{sx:{pt:"50%",position:"relative",cursor:"pointer"},children:(0,h.jsx)(R,{alt:a,src:k,onClick:()=>H(!0)})})})]})]})}function N(e){let{inventoryData:t,...o}=e;const n=(0,p.Zp)();(0,u.wA)();return!(null!==t&&void 0!==t&&t.length)>0?(0,h.jsx)("h1",{style:{marginTop:"100px"},children:"No results were found!"}):(0,h.jsx)(m.Ay,{container:!0,spacing:3,mt:5,...o,children:null===t||void 0===t?void 0:t.map(((e,t)=>(0,h.jsx)(m.Ay,{item:!0,xs:12,sm:12,md:12,children:(0,h.jsx)(B,{product:e,onNavigate:()=>n("/dashboard/inventory/vehicle",{state:{product:e}})})},t)))})}const z=[{value:"currentweek",label:"Current week"},{value:"lastweek",label:"Last week"},{value:"last4weeks",label:"Last 4 weeks"},{value:"last12weeks",label:"Last 12 weeks"}],E=[{value:"year",label:"Year: Newest First",condition:"DESC"},{value:"year",label:"Year: Oldest First",condition:"ASC"},{value:"mileage",label:"Mileage: Highest First",condition:"DESC"},{value:"mileage",label:"Mileage: Lowest First",condition:"ASC"}];function W(){const e=(0,p.Zp)(),t=(0,u.wA)(),{state:o}=(0,p.zy)(),[m,x]=(0,n.useState)(!1),[g,v]=(0,n.useState)([]),[b,y]=(0,n.useState)(null),[A,j]=(0,n.useState)(null),[f,w]=(0,n.useState)("Current week"),[k,C]=(0,n.useState)(""),[S,I]=(0,n.useState)("currentweek"),[R,D]=(0,n.useState)("ASC"),{InventoryData:F}=(0,u.d4)((e=>e.inventory)),{userInfo:B}=(0,u.d4)((e=>e.auth));(0,n.useEffect)((()=>{t((0,_.M)({timeRange:S,orderDirection:R,sortBy:k,userId:null===B||void 0===B?void 0:B.user_id}))}),[]);return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(i.A,{children:[(0,h.jsxs)(r.A,{direction:"row",alignItems:"center",justifyContent:"space-between",my:5,children:[(0,h.jsx)(l.A,{variant:"h4",sx:{my:5},children:"INVENTORY"}),(0,h.jsx)(a.A,{variant:"contained",startIcon:(0,h.jsx)(d.A,{icon:"eva:plus-fill"}),onClick:()=>e("/dashboard/inventory/newVehicle"),children:"Add"})]}),(0,h.jsxs)(r.A,{direction:"row",alignItems:"center",justifyContent:"space-between",my:5,children:[(0,h.jsxs)(r.A,{children:[(0,h.jsxs)(a.A,{color:"inherit",disableRipple:!0,onClick:e=>{j(e.currentTarget)},endIcon:(0,h.jsx)(d.A,{icon:A?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:["Sort By:\xa0",(0,h.jsx)(l.A,{component:"span",variant:"subtitle2",sx:{color:"text.secondary",borderBottom:"1px solid black"},children:k})]}),(0,h.jsx)(c.A,{keepMounted:!0,anchorEl:A,open:Boolean(A),onClose:()=>{j(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:E.map((e=>(0,h.jsx)(s.A,{selected:"year"===e.value,onClick:()=>((e,o,n)=>{t((0,_.M)({timeRange:S,orderDirection:o,sortBy:e,userId:null===B||void 0===B?void 0:B.user_id})),C(n),j(null)})(e.value,e.condition,e.label),sx:{typography:"body2"},children:e.label},e.value+"_"+e.condition)))})]}),(0,h.jsxs)(r.A,{children:[(0,h.jsx)(a.A,{color:"inherit",disableRipple:!0,onClick:e=>{x(e.currentTarget)},endIcon:(0,h.jsx)(d.A,{icon:m?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:(0,h.jsx)(l.A,{component:"span",variant:"subtitle2",sx:{borderBottom:"1px solid black"},children:f})}),(0,h.jsx)(c.A,{keepMounted:!0,anchorEl:m,open:Boolean(m),onClose:()=>{x(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:z.map((e=>(0,h.jsx)(s.A,{selected:"currentweek"===e.value,onClick:()=>((e,o)=>{I(e),C(""),t((0,_.M)({timeRange:e,orderDirection:R,sortBy:"",userId:null===B||void 0===B?void 0:B.user_id})),w(o),x(null)})(e.value,e.label),sx:{typography:"body2"},children:e.label},e.value+"_"+e.label)))})]})]}),(0,h.jsx)(N,{inventoryData:F})]})})}},3338:(e,t,o)=>{o.d(t,{Rn:()=>r});var n=o(9328),i=o.n(n);function r(e){return l(e||0===e?i()(e).format("0.00a"):"",".00")}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".00";return e.includes(t)?e.replace(t,""):e}},3568:(e,t,o)=>{e.exports=o.p+"static/media/trash.5795bffc2e3ba17cfc33.png"}}]); //# sourceMappingURL=820.94431d45.chunk.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure