import{jsxs as t,jsx as e,Fragment as p}from"react/jsx-runtime";import{F as h}from"./layout-kzl3pk8B.js";import{Head as u,Link as s}from"@inertiajs/react";import{C as f,b as x,c as y,a as N}from"./card-Zg0WOx-j.js";import{T as b,a as w,b as d,c as i,d as v,e as m}from"./table-BrXe3s2z.js";import{B as g}from"./badge-CFi7bqqA.js";import{B as o}from"./button-BvFBRYHq.js";import{ArrowLeft as H,History as T,ShoppingCart as _,Package as C,Coins as I}from"lucide-react";import{format as B}from"date-fns";import"./app-sidebar-header-BX2s-HO_.js";import"react";import"@radix-ui/react-collapsible";import"./dropdown-menu-BP80qPHw.js";import"@radix-ui/react-dropdown-menu";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"./app-logo-icon-beRg1XGs.js";import"./fonts-CqawFh47.js";import"@radix-ui/react-slot";import"class-variance-authority";import"@radix-ui/react-dialog";import"@radix-ui/react-tooltip";import"@radix-ui/react-avatar";import"../app.js";/* empty css     */import"axios";import"sonner";import"react-dom/client";import"./main-CWwoxgdq.js";import"./toaster-DuLpwsc2.js";import"./WelcomeModal-BFw-aFh5.js";import"./dialog-BfGkTFdF.js";import"./label-DMnntKPk.js";import"@radix-ui/react-label";import"./checkbox-DXBO59MA.js";import"@radix-ui/react-checkbox";function pe({logs:a}){const l=r=>new Intl.NumberFormat("id-ID").format(r),c=r=>B(new Date(r),"dd MMM yyyy HH:mm");return t(h,{children:[e(u,{title:"Purchase History"}),t("div",{className:"container py-4 px-4 md:py-8 md:px-8",children:[t("div",{className:"flex items-center gap-4 mb-6",children:[e(s,{href:route("dashboard.shop.index"),children:e(o,{variant:"ghost",size:"icon",children:e(H,{className:"h-4 w-4"})})}),t("div",{className:"flex items-center gap-3",children:[e("div",{className:"p-2 bg-primary/10 rounded-lg",children:e(T,{className:"h-6 w-6 text-primary"})}),t("div",{children:[e("h1",{className:"text-2xl font-bold",children:"Purchase History"}),e("p",{className:"text-muted-foreground text-sm",children:"View your past shop purchases"})]})]})]}),t(f,{children:[e(x,{children:t(y,{className:"flex items-center gap-2",children:[e(_,{className:"h-5 w-5"}),"Your Purchases"]})}),e(N,{children:a.data.length===0?t("div",{className:"text-center py-12",children:[e(C,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e("p",{className:"text-muted-foreground",children:"No purchase history yet."}),e(s,{href:route("dashboard.shop.index"),children:e(o,{variant:"link",children:"Go to Shop"})})]}):t(p,{children:[e("div",{className:"rounded-md border overflow-x-auto",children:t(b,{children:[e(w,{children:t(d,{children:[e(i,{children:"Date"}),e(i,{children:"Item"}),e(i,{className:"text-center",children:"Qty"}),e(i,{className:"text-right",children:"Total"})]})}),e(v,{children:a.data.map(r=>t(d,{children:[e(m,{className:"whitespace-nowrap",children:c(r.created_at)}),e(m,{children:r.item_data?.item_name||r.shop_item?.item_name||"Unknown Item"}),e(m,{className:"text-center",children:t(g,{variant:"secondary",children:["x",r.quantity]})}),e(m,{className:"text-right",children:t("span",{className:"flex items-center justify-end gap-1 text-yellow-600 dark:text-yellow-400 font-medium",children:[e(I,{className:"h-4 w-4"}),l(r.total_price)]})})]},r.id))})]})}),a.last_page>1&&e("div",{className:"flex items-center justify-center gap-2 mt-4",children:a.links.map((r,n)=>r.url===null?e(o,{variant:"outline",size:"sm",disabled:!0,dangerouslySetInnerHTML:{__html:r.label}},n):e(s,{href:r.url,children:e(o,{variant:r.active?"default":"outline",size:"sm",dangerouslySetInnerHTML:{__html:r.label}})},n))})]})})]})]})]})}export{pe as default};
