Files
boc/web/_next/static/chunks/1i7qiq_hrx76n.js
T

1 line
7.8 KiB
JavaScript
Raw Normal View History

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,143,e=>{"use strict";async function s(e,t={}){let a=localStorage.getItem("amos_token"),l=await fetch(`/api/v1${e}`,{...t,headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...t.headers}});if(!l.ok)throw Error((await l.json().catch(()=>({}))).error||`HTTP ${l.status}`);return l.json()}e.s(["api",0,{auth:{login:(e,t)=>s("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})}),me:()=>s("/auth/me")},crm:{customers:()=>s("/crm/customers")},sales:{deals:()=>s("/sales/deals")},finance:{balance:()=>s("/finance/balance"),accounts:()=>s("/finance/accounts")},hr:{employees:()=>s("/hr/employees")},legal:{contracts:()=>s("/legal/contracts")}}])},93370,e=>{"use strict";var s=e.i(1624),t=e.i(30573);e.s(["Skeleton",0,function({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"skeleton",className:(0,t.cn)("animate-pulse rounded-md bg-muted",e),...a})}])},15070,e=>{"use strict";let s=(0,e.i(64828).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,s],15070)},96302,e=>{"use strict";var s=e.i(1624),t=e.i(62714),a=e.i(34772),l=e.i(143),r=e.i(43673),c=e.i(1791),i=e.i(80063),d=e.i(93370),n=e.i(76730),x=e.i(71672),o=e.i(53743),m=e.i(6726),h=e.i(15070);let p=(0,e.i(64828).default)("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);var u=e.i(91054);e.s(["default",0,function(){let[e,j]=(0,t.useState)([]),[b,N]=(0,t.useState)(!0),[g,f]=(0,t.useState)(""),[v,w]=(0,t.useState)("");(0,t.useEffect)(()=>{l.api.crm.customers().then(e=>{j(e.customers),N(!1)}).catch(e=>{f(e.message),N(!1)})},[]);let y=e.filter(e=>e.name.toLowerCase().includes(v.toLowerCase())||e.email.toLowerCase().includes(v.toLowerCase())),E=e.reduce((e,s)=>e+s.revenue,0),B=e.filter(e=>"active"===e.status).length,C={active:"bg-emerald-50 text-emerald-700 border-emerald-200",prospect:"bg-blue-50 text-blue-700 border-blue-200",inactive:"bg-slate-50 text-slate-600 border-slate-200"};return(0,s.jsx)(a.DashboardShell,{children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-bold text-[#111827]",children:"CRM"}),(0,s.jsx)("p",{className:"text-sm text-[#6B7280] mt-0.5",children:"Customer Relationship Management"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,s.jsx)(r.Card,{className:"p-5 bg-white rounded-2xl border border-[#E5E7EB] shadow-[0_2px_8px_rgba(0,0,0,0.04)]",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-xl bg-blue-50 flex items-center justify-center",children:(0,s.jsx)(x.Users,{className:"w-5 h-5 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-[#6B7280] uppercase tracking-wider",children:"Total Customers"}),(0,s.jsx)("p",{className:"text-xl font-bold text-[#111827]",children:e.length})]})]})}),(0,s.jsx)(r.Card,{className:"p-5 bg-white rounded-2xl border border-[#E5E7EB] shadow-[0_2px_8px_rgba(0,0,0,0.04)]",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 flex items-center justify-center",children:(0,s.jsx)(o.TrendingUp,{className:"w-5 h-5 text-emerald-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-[#6B7280] uppercase tracking-wider",children:"Total Revenue"}),(0,s.jsxs)("p",{className:"text-xl font-bold text-[#111827]",children:["SEK ",(E/1e6).toFixed(1),"M"]})]})]})}),(0,s.jsx)(r.Card,{className:"p-5 bg-white rounded-2xl border border-[#E5E7EB] shadow-[0_2px_8px_rgba(0,0,0,0.04)]",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w