import{j as e,H as x,L as d}from"./app-CAqQVdqj.js";import{A as n}from"./AuthenticatedLayout-CQEcc2iz.js";import{f as s}from"./utils-f31lc4sE.js";function p({owners:a}){return e.jsxs(n,{header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Owner Wise Report"}),children:[e.jsx(x,{title:"Owner Wise Report"}),e.jsx("div",{className:"py-12",children:e.jsxs("div",{className:"mx-auto max-w-7xl sm:px-6 lg:px-8 space-y-6",children:[e.jsx("div",{className:"bg-white shadow-sm sm:rounded-lg p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Owner Wise Summary"}),e.jsx(d,{href:route("reports.index"),className:"inline-flex items-center rounded-md bg-gray-200 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-300",children:"Back to Reports"})]})}),e.jsx("div",{className:"bg-white shadow-sm sm:rounded-lg overflow-hidden",children:e.jsx("div",{className:"p-6 text-gray-900",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Owner"}),e.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium uppercase tracking-wider text-gray-500",children:"Shops"}),e.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Total Collected"}),e.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Paid to Owner"}),e.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Pending to Owner"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white",children:[a.map((t,i)=>{const r=parseFloat(t.pending_to_owner||0);return e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"whitespace-nowrap px-4 py-4 text-sm font-medium text-gray-900",children:t.owner?.name||"—"}),e.jsx("td",{className:"whitespace-nowrap px-4 py-4 text-sm text-center text-gray-500",children:t.total_shops}),e.jsx("td",{className:"whitespace-nowrap px-4 py-4 text-sm text-right text-gray-900",children:s(t.total_rent_collected)}),e.jsx("td",{className:"whitespace-nowrap px-4 py-4 text-sm text-right text-green-700",children:s(t.total_paid_to_owner)}),e.jsx("td",{className:`whitespace-nowrap px-4 py-4 text-sm text-right font-medium ${r>0?"text-red-700":"text-gray-900"}`,children:s(r)})]},i)}),a.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:"5",className:"px-4 py-4 text-center text-sm text-gray-500",children:"No data found."})})]})]})})})})]})})]})}export{p as default};
