(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9161],{43630:function(e,t,n){"use strict";var o=n(64836);t.Z=void 0;var a=o(n(64938)),r=n(85893);t.Z=(0,a.default)((0,r.jsx)("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown")},43117:function(e,t,n){"use strict";var o=n(64836);t.Z=void 0;var a=o(n(64938)),r=n(85893);t.Z=(0,a.default)((0,r.jsx)("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp")},41428:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboards/manufacturerMerchant/SalesData",function(){return n(12425)}])},12425:function(e,t,n){"use strict";n.r(t);var o=n(85893),a=n(99226),r=n(66242),i=n(15861),l=n(86886),s=n(43117),d=n(43630);t.default=e=>{let{salesData:t}=e;if(!t)return null;let formatAmount=e=>new Intl.NumberFormat("en-IN").format(e),n=[{title:"Today's Sales",amount:void 0===t.todaySales?0:t.todaySales,change:(null==t?void 0:t.salesChangePercentage)===void 0?0:null==t?void 0:t.salesChangePercentage,bgColor:"#003366"},{title:"Total Sales",amount:void 0===t.totalSales?0:t.totalSales,change:(null==t?void 0:t.monthlySalesChangePercentage)===void 0?0:null==t?void 0:t.monthlySalesChangePercentage,bgColor:"#2F4F4F"},{title:"Total Orders",amount:void 0===t.totalOrders?0:t.totalOrders,change:(null==t?void 0:t.orderChangePercentage)===void 0?0:null==t?void 0:t.orderChangePercentage,icon:"/images/misc/orders.png",bgColor:"#8B0000"},{title:"Total Customers",amount:void 0===t.uniqueCustomerCount?0:t.uniqueCustomerCount,change:(null==t?void 0:t.userChangePercentage)===void 0?0:null==t?void 0:t.userChangePercentage,icon:"/images/misc/customers.png",bgColor:"#1B3A2F"}];return(0,o.jsx)(a.Z,{children:(0,o.jsx)(l.ZP,{container:!0,spacing:3,children:n.map((e,t)=>{var n,c;return(0,o.jsx)(l.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,o.jsxs)(r.Z,{className:"dashboard-cards",sx:{padding:"1rem",borderRadius:2,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",justifyContent:"space-between",position:"relative",backgroundColor:e.bgColor},children:[(0,o.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",gap:.5,padding:"0.3rem 0.3rem",backgroundColor:"#f9f9f9",borderRadius:"20px",width:"90px",justifyContent:"center",marginBottom:"20px"},children:[void 0!==e.change?(null===(n=e.change)||void 0===n?void 0:n.toString().startsWith("-"))?(0,o.jsx)(d.Z,{fontSize:"small",color:"error"}):(0,o.jsx)(s.Z,{fontSize:"small",color:"#02590F"}):null,(0,o.jsx)(i.Z,{variant:"body2",color:void 0!==e.change&&(null===(c=e.change)||void 0===c?void 0:c.toString().startsWith("-"))?"error.main":"green",sx:{fontWeight:"bold"},children:void 0!==e.change?"".concat(new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e.change),"%"):"N/A"})]}),(0,o.jsxs)(a.Z,{children:[(0,o.jsx)(i.Z,{variant:"body2",sx:{color:"#ffffff",marginBottom:"2px",fontWeight:"bold"},gutterBottom:!0,children:e.title}),(0,o.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center"},children:[e.icon&&(0,o.jsx)("img",{src:e.icon,alt:"".concat(e.title," icon"),style:{width:24,height:24,marginRight:8,fontWeight:"bold"}}),(0,o.jsxs)(i.Z,{variant:"h5",sx:{fontWeight:"bold",color:"#ffffff"},children:["Total Orders"===e.title||"Total Customers"===e.title?formatAmount(e.amount):"₹".concat(formatAmount(e.amount))," "]})]})]})]})},t)})})})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=41428)}),_N_E=e.O()}]);