import{u as p}from"./useNumberFormat-CwY_WPnd.js";import{_ as y}from"./AppLayout.vue_vue_type_script_setup_true_lang-C-UlPCqH.js";import{d as f,o as a,a as n,b as m,e as u,h as b,w as _,f as t,t as e,F as d,n as l,i as h,j as v}from"./app-D9-EssCM.js";import"./index-CcjNLu6f.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-MNmriUeS.js";import"./VisuallyHidden-DG35s1YI.js";import"./RovingFocusGroup-Diffidi3.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./x-DwmBYYXD.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const x={class:"space-y-6 p-4"},g={class:"text-sm text-gray-600"},N={key:0,class:"rounded border border-gray-200 bg-white p-4 shadow-sm"},k={class:"mt-4 divide-y divide-gray-100"},C={class:"font-medium text-gray-900"},B={class:"text-sm text-gray-700"},j={class:"font-semibold tabular-nums"},w={class:"grid gap-4 md:grid-cols-2 xl:grid-cols-4"},$={class:"rounded border p-4"},D={class:"mt-1 text-2xl font-semibold"},V={class:"mt-3 space-y-1 text-sm"},q={class:"rounded border p-4"},F={class:"mt-1 text-2xl font-semibold"},Z={class:"mt-3 space-y-1 text-sm"},A={class:"rounded border p-4"},z={class:"mt-1 text-2xl font-semibold"},E={class:"mt-3 space-y-1 text-sm"},I={class:"rounded border p-4"},J={class:"mt-1 text-2xl font-semibold"},L={class:"mt-3 space-y-1 text-sm"},W=f({__name:"Dashboard",props:{customer:{},accountBalances:{},summary:{}},setup(Q){const{formatCurrency:c}=p();return(o,s)=>(a(),n(d,null,[m(u(b),{title:"Client Zone Dashboard"}),m(y,{breadcrumbs:[{title:"Client Zone",href:"/client-zone"}]},{default:_(()=>[t("div",x,[t("div",null,[s[0]||(s[0]=t("h1",{class:"text-2xl font-semibold"},"Client Zone Dashboard",-1)),t("p",g,e(o.customer.name)+" ("+e(o.customer.email)+")",1)]),o.accountBalances.length>0?(a(),n("div",N,[s[2]||(s[2]=t("h2",{class:"text-lg font-medium text-gray-900"},"Account balance",-1)),s[3]||(s[3]=t("p",{class:"mt-1 text-sm text-gray-600"}," Amounts from invoices and credit notes in this portal only — not synced with Xero. ",-1)),t("ul",k,[(a(!0),n(d,null,l(o.accountBalances,r=>(a(),n("li",{key:r.company_id,class:"flex flex-wrap items-center justify-between gap-2 py-3 first:pt-0"},[t("span",C,e(r.company_name),1),t("span",B,[s[1]||(s[1]=h(" Net balance: ",-1)),t("span",j,e(u(c)(r.account_balance)),1)])]))),128))])])):v("",!0),t("div",w,[t("div",$,[s[4]||(s[4]=t("h2",{class:"text-lg font-medium"},"Jobcards",-1)),t("p",D,e(o.summary.jobcards.total),1),t("div",V,[(a(!0),n(d,null,l(o.summary.jobcards.statuses,(r,i)=>(a(),n("div",{key:`jc-${i}`},e(i)+": "+e(r),1))),128))])]),t("div",q,[s[5]||(s[5]=t("h2",{class:"text-lg font-medium"},"Quotes",-1)),t("p",F,e(o.summary.quotes.total),1),t("div",Z,[(a(!0),n(d,null,l(o.summary.quotes.statuses,(r,i)=>(a(),n("div",{key:`qt-${i}`},e(i)+": "+e(r),1))),128))])]),t("div",A,[s[6]||(s[6]=t("h2",{class:"text-lg font-medium"},"Invoices",-1)),t("p",z,e(o.summary.invoices.total),1),t("div",E,[(a(!0),n(d,null,l(o.summary.invoices.statuses,(r,i)=>(a(),n("div",{key:`inv-${i}`},e(i)+": "+e(r),1))),128))])]),t("div",I,[s[7]||(s[7]=t("h2",{class:"text-lg font-medium"},"Credit Notes",-1)),t("p",J,e(o.summary.creditNotes.total),1),t("div",L,[(a(!0),n(d,null,l(o.summary.creditNotes.statuses,(r,i)=>(a(),n("div",{key:`cn-${i}`},e(i)+": "+e(r),1))),128))])])])])]),_:1})],64))}});export{W as default};
