import{u as j,a as k,G as g,j as e,H as f,L as b}from"./app-CyJEXGyv.js";import{A as N,u as o}from"./app-layout-DbUGBUec.js";import{P as D}from"./page-pagination-f8WRSjxd.js";import{T,a as H,b as P,c as v,d,e as s,f as w,g as A,h as t}from"./table-fuaFg2Mm.js";import{A as C,M as B}from"./modal-delete-CUfNw5Hz.js";import{H as y}from"./heading-BLley4b9.js";import{B as M}from"./button-COEJSQkW.js";import{B as l}from"./badge-BSEA-Kjk.js";import{C as L}from"./trash-BflsAFp1.js";import"./utils-D3rN0LeJ.js";import"./sheet-D9YCjyPN.js";import"./index-JbHgsFAK.js";import"./index-BiS8IM9B.js";import"./x-CEXz2EER.js";import"./createLucideIcon-DqnlFWer.js";import"./index-CeYyXWc4.js";import"./index-D448AvbX.js";import"./truck-DSNzHzca.js";import"./package-Ca-wQg6n.js";import"./shopping-bag-kX2qM3ec.js";import"./app-logo-icon-bwP4qd8Q.js";import"./bluetooth-context-DlC5mQaA.js";import"./index-BtT9Eyya.js";import"./index-l-_2VD5G.js";import"./sonner-DMUJNVEP.js";import"./pagination-7aOfsluw.js";import"./chevron-left-O9iIxqlL.js";import"./select-787Dhddj.js";import"./chevron-down-CelnyKCC.js";import"./input-De4RhZu7.js";import"./dialog-C64V63Fe.js";const S=[{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:""}),[u,n]=g.useState(!1),h=a=>{n(!0),x(i=>({...i,id:a.id}))};return e.jsxs(N,{breadcrumbs:S,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(L,{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(H,{className:"mt-5",children:e.jsxs(P,{children:[e.jsx(v,{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(w,{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:()=>h(a)})})})]},i))})]})}),e.jsx(B,{open:u,onOpenChange:n,url:route("apps.discount-packages.destroy",m.id)}),e.jsx(D,{data:r})]})]})]})}export{me as default};
