import{q as j,v as k,U as f,j as e,$ as b,Y as g}from"./app-CffHYkHW.js";import{A as D,u as o}from"./app-layout-D-VS7nVU.js";import{P as N}from"./page-pagination-haDwcr6r.js";import{T,a as v,b as P,c as w,d as n,e as a,f as A,g as H,h as t}from"./table-DVZTgtP_.js";import{A as y,M as C}from"./modal-delete-CrQxv22H.js";import{H as B}from"./heading-YfudWo2z.js";import{B as M}from"./button-qhe8lrPU.js";import{B as l}from"./badge-soq0-NVD.js";import{C as _}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 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(B,{title:"Diskon Produk",description:"Halaman ini digunakan untuk mengelola data diskon produk"}),o(["discount-products-create"])&&e.jsx(M,{asChild:!0,variant:"outline",children:e.jsxs(g,{href:route("apps.discount-products.create"),children:[e.jsx(_,{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(P,{children:[e.jsx(w,{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(A,{children:r.data.length===0?e.jsx(H,{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};
