import{_ as t}from"./Di_95mgX.js";import{_ as o}from"./C-jt9Ih2.js";import{h as l,e as m,u,k as p,i as s,v as d,o as c,w as g}from"./BzhixHsn.js";import"./4isL45Eu.js";import"./C9XbPd6k.js";import"./BTANIQ8V.js";import"./Di109XjC.js";import"./CRjpF7qy.js";import"./IgXGHcdR.js";import"./COjiOs1v.js";import"./Bp3-KBkO.js";import"./DKMWZZOl.js";import"./XCOtPLqC.js";import"./Bi0Cqvs9.js";import"./C56gk0qC.js";import"./BmCC6msl.js";import"./vJ3Jskde.js";import"./BYr6U6oc.js";import"./C-zlyDS5.js";import"./KyMCIHQI.js";import"./C8B8ONuC.js";import"./CW7RC7pq.js";import"./DhvzP0AS.js";import"./DzpHhHXI.js";import"./2RVX2kid.js";import"./C-9Ampo3.js";import"./C-xhCs27.js";import"./Le8goM6p.js";import"./_XME2JEy.js";import"./BkS3akZz.js";import"./BLw_G03o.js";import"./B9I6JWJy.js";import"./CHh9YBUH.js";import"./zIw-xwcH.js";import"./BVAf69h5.js";import"./EdM3CJ8e.js";const Y=l({__name:"index",setup(f){const{t:e}=m();u({title:e("pageTitle.adminUsers")});const n=p(()=>({title:e("admin.pages.users.title"),description:e("admin.pages.users.description"),apiEndpoint:"/v1/admin/users",apiEndpoints:{updateMethod:"PATCH"},columns:[{accessorKey:"email",header:e("admin.pages.users.email"),cell:a=>{const i=a.getValue();return s("button",{class:"text-primary font-medium cursor-pointer text-left focus:outline-none focus:ring-2 focus:ring-primary/40 rounded-full bg-muted/30 hover:bg-muted/60 hover:underline px-2 py-0.5 transition-colors",onClick:()=>a.table.options.meta?.triggerRowAction?.({key:"view",label:"view"},a.row.original)},i)}},{accessorKey:"name",header:e("admin.pages.users.name"),cell:a=>{const i=a.getValue();return i?s("button",{class:"text-primary font-medium cursor-pointer text-left focus:outline-none focus:ring-2 focus:ring-primary/40 rounded-full bg-muted/30 hover:bg-muted/60 hover:underline px-2 py-0.5 transition-colors",onClick:()=>a.table.options.meta?.triggerRowAction?.({key:"view",label:"view"},a.row.original)},i):"-"}},{accessorKey:"is_active",header:e("admin.pages.users.status"),cell:a=>{const i=a.getValue(),r=a.row.original.is_verified;return s("div",{class:"flex gap-2"},[s(t,{variant:i?"default":"secondary"},()=>e(i?"admin.pages.users.active":"admin.pages.users.inactive")),r&&s(t,{variant:"default"},()=>e("admin.pages.users.verified"))])}},{accessorKey:"is_superuser",header:e("admin.pages.users.roles"),cell:a=>a.getValue()?s(t,{variant:"destructive"},()=>e("admin.pages.users.admin")):s("span",{class:"text-muted-foreground"},e("admin.pages.users.user"))},{accessorKey:"created_at",header:e("admin.pages.users.createdAt"),cell:a=>{const i=a.getValue();return new Date(i).toLocaleString()}}],formFields:[{name:"email",label:e("admin.pages.users.email"),type:"email",required:!0,disabled:!0},{name:"name",label:e("admin.pages.users.name"),type:"text"},{name:"is_active",label:e("admin.pages.users.active"),type:"switch"},{name:"is_verified",label:e("admin.pages.users.verified"),type:"switch"},{name:"is_superuser",label:e("admin.pages.users.isAdmin"),type:"switch"}],filters:{is_active:{type:"select",label:e("admin.pages.users.filterActive"),options:[{label:e("admin.pages.users.active"),value:"true"},{label:e("admin.pages.users.inactive"),value:"false"}]},is_verified:{type:"select",label:e("admin.pages.users.filterVerified"),options:[{label:e("admin.pages.users.verified"),value:"true"},{label:e("admin.pages.users.unverified"),value:"false"}]},is_superuser:{type:"select",label:e("admin.pages.users.filterAdmin"),options:[{label:e("admin.pages.users.isAdmin"),value:"true"},{label:e("admin.pages.users.notAdmin"),value:"false"}]}},detailFields:[{name:"id",label:"ID"},{name:"email",label:e("admin.pages.users.email")},{name:"name",label:e("admin.pages.users.name")},{name:"avatar_url",label:e("admin.pages.users.avatarUrl")},{name:"is_active",label:e("admin.pages.users.active"),type:"boolean"},{name:"is_verified",label:e("admin.pages.users.verified"),type:"boolean"},{name:"is_superuser",label:e("admin.pages.users.isAdmin"),type:"boolean"},{name:"created_at",label:e("admin.pages.users.createdAt"),type:"datetime"}],canCreate:!1,canDelete:!0,canEdit:!0,showFilters:!0,selectable:!0}));return(a,i)=>{const r=o;return c(),d(r,{config:n.value},{actions:g(()=>[...i[0]||(i[0]=[])]),_:1},8,["config"])}}});export{Y as default};
