import{_ as g}from"./AdminLayout-DeT_GLTC.js";import{d as x,s as C,r as u,y as D,c as l,o as n,b as i,a as t,e as h,i as p,t as o,u as s,f as a,F as f,g as $,l as B,n as I,w as z}from"./app-Do7K7VDV.js";import{_ as A}from"./Paginate-BZTS8QtF.js";import{h as E}from"./moment-BAtM24Ew.js";import{_ as L}from"./FilterDropdown-HyKaUaTA.js";import{_ as M}from"./NoDataFound-oJx-Mfyi.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./InputFieldError-0BmYlL24.js";import"./ToastrContainer-CtYDvNPN.js";import"./SpinnerBtn-C-rqKjUt.js";const N={class:"table-responsive mt-2 whitespace-nowrap rounded-primary"},V={class:"table"},j={class:"col-3"},q={class:"col-3"},F={class:"col-1"},O={class:"col-2"},S={class:"col-1"},T={class:"text-right"},R={key:0},Y={class:"flex"},G={key:0,class:"avatar rounded-square mr-3"},H=["href"],J={class:"text-left"},K={class:"flex justify-end"},P={class:"dropdown","data-placement":"bottom-start"},Q={class:"dropdown-toggle"},U={class:"dropdown-content w-40"},W={class:"dropdown-list"},X={class:"dropdown-list-item"},Z={class:"dropdown-list-item"},tt=["onClick"],st=x({layout:g}),pt=Object.assign(st,{__name:"Index",props:["posts","request"],setup(c){const{textExcerpt:v,deleteRow:k}=C(),w=[{label:"Title",value:"title"}];return(r,et)=>{const d=u("Icon"),y=u("Link"),b=D("lazy");return n(),l(f,null,[i(L,{options:w}),t("div",N,[t("table",V,[t("thead",null,[t("tr",null,[t("th",j,o(s(a)("ID")),1),t("th",q,o(s(a)("Title")),1),t("th",F,o(s(a)("Status")),1),t("th",O,o(s(a)("Created At")),1),t("th",S,[t("div",T,o(s(a)("Action")),1)])])]),c.posts.data!=0?(n(),l("tbody",R,[(n(!0),l(f,null,$(c.posts.data,e=>{var _,m;return n(),l("tr",{key:e.id},[t("td",null,o(e.id),1),t("td",Y,[(_=e.preview)!=null&&_.value?B((n(),l("img",G,null,512)),[[b,(m=e.preview)==null?void 0:m.value]]):p("",!0),t("a",{target:"_blank",href:`/blogs/${e.slug}`},o(s(v)(e.title,80)),9,H)]),t("td",J,[t("span",{class:I(["badge",e.status==1?"badge-success":"badge-danger"])},o(e.status==1?s(a)("Active"):s(a)("Draft")),3)]),t("td",null,o(s(E)(e.created_at).format("D-MMM-Y")),1),t("td",null,[t("div",K,[t("div",P,[t("div",Q,[i(d,{class:"w-30 text-lg",icon:"bi:three-dots-vertical"})]),t("div",U,[t("ul",W,[t("li",X,[i(y,{href:r.route("admin.blog.edit",e.id),class:"dropdown-link"},{default:z(()=>[i(d,{class:"h-6 text-slate-400",icon:"material-symbols:edit-outline"}),t("span",null,o(s(a)("Edit")),1)]),_:2},1032,["href"])]),t("li",Z,[t("button",{class:"dropdown-link",onClick:ot=>s(k)(r.route("admin.blog.destroy",e.slug))},[i(d,{class:"h-6",icon:"material-symbols:delete-outline"}),t("span",null,o(s(a)("Delete")),1)],8,tt)])])])])])])])}),128))])):(n(),h(M,{key:1,"for-table":"true"}))]),c.posts.data.length!=0?(n(),h(A,{key:0,links:c.posts.links},null,8,["links"])):p("",!0)])],64)}}});export{pt as default};
