import{q as j,v as k,U as g,j as e,$ as f,Y as b}from"./app-CffHYkHW.js";import{A as N,u as o}from"./app-layout-D-VS7nVU.js";import{P as D}from"./page-pagination-haDwcr6r.js";import{T,a as v,b as P,c as w,d,e as s,f as H,g as A,h as t}from"./table-DVZTgtP_.js";import{A as C,M as B}from"./modal-delete-CrQxv22H.js";import{H as y}from"./heading-YfudWo2z.js";import{B as M}from"./button-qhe8lrPU.js";import{B as l}from"./badge-soq0-NVD.js";import{C as S}from"./trash-o9eyCj69.js";import"./utils-C8zp8JNC.js";import"./sheet-Bisw0FSz.js";import"./index-C0loMkA3.js";import"./index-Cy5bElus.js";import"./index-DPkgfxsD.js";import"./x-BfabuQJD.js";import"./createLucideIcon-DAR-hy5d.js";import"./index-C9NeyPdJ.js";import"./index-CjqRk3xD.js";import"./truck-DnoS8QCL.js";import"./package-BHw0cifz.js";import"./shopping-bag-AryJS2XX.js";import"./app-logo-icon-D3Jzt_fn.js";import"./bluetooth-context-CLrE8g1i.js";import"./index-Dw4sHwMN.js";import"./sonner-CPUj7IiR.js";import"./pagination-DsNVVp24.js";import"./chevron-left-D6h0rvW2.js";import"./select-ClrGyhQo.js";import"./chevron-down-C5A3yn87.js";import"./input-Bw4IOOzt.js";import"./dialog-Djfc3pyN.js";const E=[{title:"Diskon Paket",href:route("apps.discount-packages.index")}];function me(){const{discountPackages:r,perPage:c,currentPage:p}=j().props,{data:m,setData:x}=k({id:""}),[h,n]=g.useState(!1),u=a=>{n(!0),x(i=>({...i,id:a.id}))};return e.jsxs(N,{breadcrumbs:E,children:[e.jsx(f,{title:"Diskon Paket"}),e.jsxs("div",{className:"p-4 bg-background text-foreground transition-colors",children:[e.jsx(y,{title:"Diskon Paket",description:"Halaman ini digunakan untuk mengelola data diskon paket"}),e.jsxs("div",{className:"border border-border bg-card text-card-foreground shadow-sm rounded-xl p-4",children:[o(["discount-packages-create"])&&e.jsx(M,{asChild:!0,variant:"outline",children:e.jsxs(b,{href:route("apps.discount-packages.create"),children:[e.jsx(S,{className:"size-4"})," ",e.jsx("span",{className:"hidden sm:inline-flex font-semibold",children:"Tambah Diskon Paket"})]})}),e.jsx("div",{className:"mt-6",children:e.jsx(T,{withFilterPage:!0,currentPage:p,perPage:c,url:route("apps.discount-packages.index"),placeholder:"Cari data diskon paket berdasakan nama diskon paket"})}),e.jsx(v,{className:"mt-5",children:e.jsxs(P,{children:[e.jsx(w,{children:e.jsxs(d,{children:[e.jsx(s,{className:"w-[10px]",children:"No"}),e.jsx(s,{children:"Gambar Diskon Paket"}),e.jsx(s,{children:"Nama Diskon Paket"}),e.jsx(s,{children:"Harga"}),e.jsx(s,{className:"w-[10px]",children:"Status"}),e.jsx(s,{className:"w-[10px] text-center",children:"Aksi"})]})}),e.jsx(H,{children:r.data.length===0?e.jsx(A,{colSpan:5,message:"data diskon paket"}):r.data.map((a,i)=>e.jsxs(d,{children:[e.jsx(t,{className:"text-center",children:i+1}),e.jsx(t,{children:e.jsx("img",{src:a.image,className:"w-10 h-10"})}),e.jsx(t,{children:a.name}),e.jsxs(t,{children:[e.jsx("sup",{children:"Rp"})," ",a.total_price.toLocaleString()]}),e.jsx(t,{className:"capitalize",children:a.is_active=="1"?e.jsx(l,{variant:"default",children:"Aktif"}):e.jsx(l,{variant:"destructive",children:"Tidak Aktif"})}),e.jsx(t,{children:e.jsx("div",{className:"text-center",children:(o(["discount-packages-update"])||o(["discount-packages-delete"]))&&e.jsx(C,{permissionPrefix:"discount-packages",withDetail:!0,actionDetailHref:route("apps.discount-packages.show",a.id),actionEditHref:route("apps.discount-packages.edit",a.id),actionDelete:()=>u(a)})})})]},i))})]})}),e.jsx(B,{open:h,onOpenChange:n,url:route("apps.discount-packages.destroy",m.id)}),e.jsx(D,{data:r})]})]})]})}export{me as default};
