import{u as j,a as k,G as f,j as e,H as b,L as g}from"./app-CyJEXGyv.js";import{A as D,u as o}from"./app-layout-DbUGBUec.js";import{P as N}from"./page-pagination-f8WRSjxd.js";import{T,a as v,b as H,c as P,d as n,e as a,f as w,g as A,h as t}from"./table-fuaFg2Mm.js";import{A as y,M as C}from"./modal-delete-CUfNw5Hz.js";import{H as _}from"./heading-BLley4b9.js";import{B}from"./button-COEJSQkW.js";import{B as l}from"./badge-BSEA-Kjk.js";import{C as M}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 E=[{title:"Diskon Produk",href:route("apps.discount-products.index")}];function me(){const{discountProducts:r,perPage:c,currentPage:p}=j().props,{data:m,setData:u}=k({id:""}),[x,d]=f.useState(!1),h=s=>{d(!0),u(i=>({...i,id:s.id}))};return e.jsxs(D,{breadcrumbs:E,children:[e.jsx(b,{title:"Diskon Produk"}),e.jsx("div",{className:"p-4 bg-background text-foreground transition-colors",children:e.jsxs("div",{className:"border border-border bg-card text-card-foreground shadow-sm rounded-xl p-4",children:[e.jsx(_,{title:"Diskon Produk",description:"Halaman ini digunakan untuk mengelola data diskon produk"}),o(["discount-products-create"])&&e.jsx(B,{asChild:!0,variant:"outline",children:e.jsxs(g,{href:route("apps.discount-products.create"),children:[e.jsx(M,{className:"size-4"})," ",e.jsx("span",{className:"hidden sm:inline-flex font-semibold",children:"Tambah Diskon Produk"})]})}),e.jsx("div",{className:"mt-6",children:e.jsx(T,{withFilterPage:!0,currentPage:p,perPage:c,url:route("apps.discount-products.index"),placeholder:"Cari data diskon paket berdasakan nama diskon paket"})}),e.jsx(v,{className:"mt-5",children:e.jsxs(H,{children:[e.jsx(P,{children:e.jsxs(n,{children:[e.jsx(a,{className:"w-[10px]",children:"No"}),e.jsx(a,{children:"Nama Diskon Produk"}),e.jsx(a,{children:"Minimum Pembelian"}),e.jsx(a,{children:"Jenis Diskon"}),e.jsx(a,{children:"Total Diskon"}),e.jsx(a,{className:"w-[10px]",children:"Status"}),e.jsx(a,{className:"w-[10px] text-center",children:"Aksi"})]})}),e.jsx(w,{children:r.data.length===0?e.jsx(A,{colSpan:7,message:"data diskon produk"}):r.data.map((s,i)=>e.jsxs(n,{children:[e.jsx(t,{className:"text-center",children:i+1}),e.jsx(t,{children:s.discount_name}),e.jsx(t,{children:s.discount_quantity}),e.jsx(t,{children:s.discount_type}),e.jsx(t,{children:s.discount_value}),e.jsx(t,{className:"capitalize",children:s.is_active?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-products-update"])||o(["discount-products-delete"]))&&e.jsx(y,{permissionPrefix:"discount-products",withDetail:!0,actionDetailHref:route("apps.discount-products.show",s.id),actionEditHref:route("apps.discount-products.edit",s.id),actionDelete:()=>h(s)})})})]},i))})]})}),e.jsx(C,{open:x,onOpenChange:d,url:route("apps.discount-products.destroy",m.id)}),e.jsx(N,{data:r})]})})]})}export{me as default};
