Files

1 line
8.5 KiB
JavaScript
Raw Permalink Normal View History

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,143,e=>{"use strict";async function t(e,s={}){let a=localStorage.getItem("amos_token"),l=await fetch(`/api/v1${e}`,{...s,headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...s.headers}});if(!l.ok)throw Error((await l.json().catch(()=>({}))).error||`HTTP ${l.status}`);return l.json()}e.s(["api",0,{auth:{login:(e,s)=>t("/auth/login",{method:"POST",body:JSON.stringify({email:e,password:s})}),me:()=>t("/auth/me")},crm:{customers:()=>t("/crm/customers")},sales:{deals:()=>t("/sales/deals")},finance:{balance:()=>t("/finance/balance"),accounts:()=>t("/finance/accounts")},hr:{employees:()=>t("/hr/employees")},legal:{contracts:()=>t("/legal/contracts")}}])},93370,e=>{"use strict";var t=e.i(1624),s=e.i(30573);e.s(["Skeleton",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,s.cn)("animate-pulse rounded-md bg-muted",e),...a})}])},18410,e=>{"use strict";let t=(0,e.i(64828).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],18410)},56696,e=>{"use strict";let t=(0,e.i(64828).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],56696)},90963,e=>{"use strict";let t=(0,e.i(64828).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,t],90963)},49915,e=>{"use strict";var t=e.i(1624),s=e.i(62714),a=e.i(34772),l=e.i(143),r=e.i(43673),c=e.i(80063),d=e.i(93370),i=e.i(25599),n=e.i(18410),x=e.i(56696),o=e.i(90963),h=e.i(91054);e.s(["default",0,function(){let[e,m]=(0,s.useState)([]),[p,j]=(0,s.useState)(!0),[u,b]=(0,s.useState)("");(0,s.useEffect)(()=>{l.api.legal.contracts().then(e=>{m(e.contracts),j(!1)}).catch(e=>{b(e.message),j(!1)})},[]);let N=e.reduce((e,t)=>e+t.value,0),g=e.filter(e=>{if(!e.endDate)return!1;let t=new Date(e.endDate),s=new Date,a=(t.getTime()-s.getTime())/864e5;return a<90&&a>0}).length,y={service:"bg-blue-50 text-blue-700 border-blue-200",lease:"bg-violet-50 text-violet-700 border-violet-200",license:"bg-amber-50 text-amber-700 border-amber-200",employment:"bg-emerald-50 text-emerald-700 border-emerald-200",insurance:"bg-cyan-50 text-cyan-700 border-cyan-200"};return(0,t.jsx)(a.DashboardShell,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-bold text-[#111827]",children:"Legal"}),(0,t.jsx)("p",{className:"text-sm text-[#6B7280] mt-0.5",children:"Contracts and legal documents"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[(0,t.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,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-xl bg-blue-50 flex items-center justify-center",children:(0,t.jsx)(i.Scale,{className:"w-5 h-5 text-blue-600"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-[#6B7280] uppercase tracking-wider",children:"Total Contracts"}),(0,t.jsx)("p",{className:"text-xl font-bold text-[#111827]",children:e.length})]})]})}),(0,t.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,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 flex items-center justify-center",children:(0,t.jsx)(n.FileText,{className:"w-5 h-5