import{h as b}from"./moment-a9aaa855.js";import{s as g,p as s,h as m,x as w,c,a as n,b as t,t as e,u as o,F as k,r as y,i as x,g as T,o as l,d as C,n as A,j as D}from"./app-13978987.js";import{_ as I}from"./AdminLayout-bd13ff9d.js";import{_ as z}from"./PageHeader-8c638686.js";import $ from"./OverviewGrid-21ea6fc2.js";import{_ as B}from"./NoDataFound-bc81d7fa.js";import"./dropdown-45d66330.js";const L={class:"container flex-grow p-4 sm:p-6"},M={class:"space-y-6"},N={class:"card"},j={class:"table-responsive whitespace-nowrap rounded-primary"},E={class:"table"},F={class:"text-right"},S={key:0},V={class:"avatar rounded-square w-70-per"},q={class:"capitalize"},O={class:"dropdown","data-placement":"bottom-start"},P={class:"dropdown-toggle"},R={class:"dropdown-content w-40"},Y={class:"dropdown-list"},G={class:"dropdown-list-item"},H={class:"dropdown-list-item"},J=["onClick"],K=T({layout:I}),at=Object.assign(K,{__name:"Index",props:["templates","totalTemplates","activeTemplates","inActiveTemplates","buttons","segments"],setup(i){const{deleteRow:u,trim:p}=g(),r=i,h=[{value:r.totalTemplates,title:s("Total Templates"),iconClass:"bx:bar-chart"},{value:r.activeTemplates,title:s("Active Templates"),iconClass:"bx:check-circle"},{value:r.inActiveTemplates,title:s("Inactive Templates"),iconClass:"bx:x-circle"}];return(_,Q)=>{const d=m("Icon"),v=m("Link"),f=w("lazy");return l(),c("main",L,[n(z,{title:"AI Templates",buttons:i.buttons},null,8,["buttons"]),t("div",M,[n($,{items:h,grid:"3"}),t("div",N,[t("div",j,[t("table",E,[t("thead",null,[t("tr",null,[t("th",null,e(o(s)("Image")),1),t("th",null,e(o(s)("Name")),1),t("th",null,e(o(s)("Prompt Type")),1),t("th",null,e(o(s)("Description")),1),t("th",null,e(o(s)("Created At")),1),t("th",null,e(o(s)("Status")),1),t("th",null,[t("p",F,e(o(s)("Action")),1)])])]),i.templates.total?(l(),c("tbody",S,[(l(!0),c(k,null,y(i.templates.data,a=>(l(),c("tr",{key:a.id},[t("td",null,[C(t("img",V,null,512),[[f,a.icon]])]),t("td",null,e(a.title),1),t("td",q,e(o(p)(a.prompt_type)),1),t("td",null,e(a.description),1),t("td",null,e(o(b)(a.created_at).format("D-MMM-Y")),1),t("td",null,[t("span",{class:A(["badge",a.status=="active"?"badge-success":"badge-danger"])},e(a.status=="active"?o(s)("Active"):o(s)("Draft")),3)]),t("td",null,[t("div",O,[t("div",P,[n(d,{class:"text-2xl",icon:"bx:dots-horizontal-rounded"})]),t("div",R,[t("ul",Y,[t("li",G,[n(v,{href:_.route("admin.ai-templates.edit",a),class:"dropdown-link"},{default:D(()=>[n(d,{icon:"fe:edit"}),t("span",null,e(o(s)("Edit")),1)]),_:2},1032,["href"])]),t("li",H,[t("button",{onClick:U=>o(u)(_.route("admin.ai-templates.destroy",a)),class:"dropdown-link"},[n(d,{icon:"fe:trash"}),t("span",null,e(o(s)("Delete")),1)],8,J)])])])])])]))),128))])):(l(),x(B,{key:1,"for-table":!0}))])])])])])}}});export{at as default};
