import{Kt as e,Q as t,Qt as n,R as r,Tn as i,Y as a,Z as o,at as s,fr as c,i as l,it as u,or as d,r as f,st as p}from"./dist-CoD0k1Bd.js";import{t as m}from"./external-link-B6J7_Ipw.js";import{t as h}from"./plus-DrIll_vd.js";import{t as g}from"./search-B4f4vYLn.js";import{t as _}from"./Input-C3DwKNOf.js";import{t as v}from"./button-mN_poAXs.js";import{t as y}from"./routes-BZ4t1sNs.js";import{t as b}from"./Heading-CCd5Tysh.js";import{t as x}from"./badge-n_RZ0blh.js";import{t as S}from"./Pagination-BRYVDO_a.js";var C={class:`flex flex-col space-y-6`},w={class:`flex items-center justify-between gap-4`},T={class:`w-full max-w-sm`},E={method:`GET`,action:`/kategoris`},D={class:`relative`},O={class:`overflow-hidden rounded-xl border`},k={class:`w-full text-sm`},A={class:`divide-y`},j={class:`px-4 py-3 font-medium`},M={class:`px-4 py-3 font-medium`},N={class:`px-4 py-3`},P={class:`px-4 py-3`},F=[`href`],I={class:`px-4 py-3 text-right tabular-nums`},L={class:`px-4 py-3 text-right tabular-nums`},R={class:`px-4 py-3 text-center`},z={class:`px-4 py-3 text-right`},B={key:0},V=p({layout:{breadcrumbs:[{title:`Dashboard`,href:y()},{title:`Kategori Landing`,href:`/kategoris`}]},__name:`Index`,props:{kategoris:{},filters:{},appUrl:{}},setup(p){let y=p;return(p,V)=>(e(),t(r,null,[s(d(f),{title:`Kategori Landing`}),a(`div`,C,[a(`div`,w,[s(b,{title:`Kategori Landing`,description:`Kategori untuk rotator iklan publik`}),s(d(v),{"as-child":``},{default:i(()=>[s(d(l),{href:`/kategoris/create`},{default:i(()=>[s(d(h),{class:`size-4`}),V[0]||=u(` Tambah Kategori`,-1)]),_:1})]),_:1})]),a(`div`,T,[a(`form`,E,[a(`div`,D,[s(d(g),{class:`absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),s(d(_),{name:`search`,"default-value":y.filters.search??``,placeholder:`Cari kategori…`,class:`pl-9`},null,8,[`default-value`])])])]),a(`div`,O,[a(`table`,k,[V[4]||=a(`thead`,{class:`bg-muted/50 text-left text-xs uppercase text-muted-foreground`},[a(`tr`,null,[a(`th`,{class:`px-4 py-3 font-medium`},`Kategori`),a(`th`,{class:`px-4 py-3 font-medium`},`Judul`),a(`th`,{class:`px-4 py-3 font-medium`},`Jenis`),a(`th`,{class:`px-4 py-3 font-medium`},`URL Landing`),a(`th`,{class:`px-4 py-3 font-medium text-right`},`Campaign`),a(`th`,{class:`px-4 py-3 font-medium text-right`},`Dilihat`),a(`th`,{class:`px-4 py-3 font-medium text-center`},`Status`),a(`th`,{class:`px-4 py-3 font-medium text-right`},`Aksi`)])],-1),a(`tbody`,A,[(e(!0),t(r,null,n(y.kategoris.data,n=>(e(),t(`tr`,{key:n.id,class:`hover:bg-muted/30`},[a(`td`,j,c(n.nama_kategori),1),a(`td`,M,c(n.judul),1),a(`td`,N,[s(d(x),{variant:n.jenis===`Redirect`?`outline`:`secondary`},{default:i(()=>[u(c(n.jenis),1)]),_:2},1032,[`variant`])]),a(`td`,P,[a(`a`,{href:`${y.appUrl}/landing/${n.alias}`,target:`_blank`,class:`inline-flex items-center gap-1 font-mono text-xs text-primary hover:underline`},[u(c(y.appUrl)+`/landing/`+c(n.alias)+` `,1),s(d(m),{class:`size-3 shrink-0`})],8,F)]),a(`td`,I,c(n.ads_count.toLocaleString(`id-ID`)),1),a(`td`,L,c(n.viewed.toLocaleString(`id-ID`)),1),a(`td`,R,[s(d(x),{variant:n.status?`default`:`outline`},{default:i(()=>[u(c(n.status?`Aktif`:`Nonaktif`),1)]),_:2},1032,[`variant`])]),a(`td`,z,[s(d(v),{"as-child":``,variant:`ghost`,size:`sm`},{default:i(()=>[s(d(l),{href:`/kategoris/${n.id}/report`},{default:i(()=>[...V[1]||=[u(`Report`,-1)]]),_:1},8,[`href`])]),_:2},1024),s(d(v),{"as-child":``,variant:`ghost`,size:`sm`},{default:i(()=>[s(d(l),{href:`/kategoris/${n.id}/edit`},{default:i(()=>[...V[2]||=[u(`Edit`,-1)]]),_:1},8,[`href`])]),_:2},1024)])]))),128)),y.kategoris.data.length===0?(e(),t(`tr`,B,[...V[3]||=[a(`td`,{colspan:`8`,class:`px-4 py-8 text-center text-muted-foreground`},`Belum ada kategori.`,-1)]])):o(``,!0)])])]),s(S,{links:y.kategoris.links,from:y.kategoris.from,to:y.kategoris.to,total:y.kategoris.total},null,8,[`links`,`from`,`to`,`total`])])],64))}});export{V as default};