import{K as x,j as e,S as r}from"./app-BMysVXg2.js";/* empty css            */function p(){const{message:d,stats:l,waktu:n,activeTab:i,infoUmum:a,grafik:c,riwayat:t}=x().props,o=()=>{r.visit("/test/dashboard",{only:["waktu"],preserveState:!0})},h=s=>{r.visit(route("test.dashboard"),{method:"get",data:{tab:s},only:[s,"activeTab"],preserveState:!0})};return e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx("h1",{className:"text-xl font-bold",children:"Dashboard Test"}),e.jsx("p",{children:d}),e.jsxs("div",{className:"bg-gray-100 p-4 rounded",children:[e.jsx("h2",{className:"font-semibold mb-2",children:"Statistik"}),e.jsxs("p",{children:["Siswa: ",l.siswa]}),e.jsxs("p",{children:["Guru: ",l.guru]}),e.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Diperbarui: ",n]}),e.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-blue-600 text-white rounded",children:"Refresh Statistik"})]}),e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-xl font-bold mb-4",children:"Dashboard Interaktif"}),e.jsx("div",{className:"space-x-2 mb-6",children:["infoUmum","grafik","riwayat"].map(s=>e.jsx("button",{onClick:()=>h(s),className:`px-4 py-2 rounded ${i===s?"bg-blue-600 text-white":"bg-gray-200"}`,children:s},s))}),e.jsxs("div",{className:"bg-white p-4 rounded shadow",children:[i==="infoUmum"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Info Umum"}),e.jsxs("p",{children:["Siswa: ",a==null?void 0:a.jumlahSiswa]}),e.jsxs("p",{children:["Guru: ",a==null?void 0:a.jumlahGuru]})]}),i==="grafik"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Grafik Pendaftaran"}),e.jsx("pre",{children:JSON.stringify(c,null,2)})]}),i==="riwayat"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Riwayat Transaksi"}),e.jsxs("form",{onSubmit:s=>{s.preventDefault(),r.visit(route("test.dashboard"),{method:"get",data:{tab:"riwayat",filter:document.getElementById("filterInput").value},only:["riwayat","activeTab"],preserveState:!0})},className:"mb-4 space-x-2",children:[e.jsx("input",{id:"filterInput",defaultValue:new URLSearchParams(location.search).get("filter")||"",placeholder:"Cari transaksi...",className:"border px-3 py-1 rounded"}),e.jsx("button",{type:"submit",className:"bg-blue-600 text-white px-3 py-1 rounded",children:"Cari"})]}),e.jsxs("ul",{children:[(t==null?void 0:t.length)===0&&e.jsx("li",{children:"Tidak ada data."}),t==null?void 0:t.map(s=>e.jsxs("li",{children:[s.nama," - Rp",s.total.toLocaleString()]},s.id))]})]})]})]})]})}export{p as default};
