import{jsx as e,jsxs as s}from"react/jsx-runtime";import{B as n}from"./button-BvFBRYHq.js";import{T as m,a as h,b as o,c as g,d as u,e as i}from"./table-BrXe3s2z.js";import{ArrowUpDown as c}from"lucide-react";import{flexRender as d}from"@tanstack/react-table";import{Link as p}from"@inertiajs/react";import{C as f,g as x}from"./class-icon-CASn9-jM.js";import{RoleBadge as N}from"./roleHelpers-CE-Z4Z4s.js";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"./badge-CFi7bqqA.js";function M({table:r,columns:t}){return e("div",{className:"rounded-md border",children:s(m,{children:[e(h,{children:r.getHeaderGroups().map(a=>e(o,{children:a.headers.map(l=>e(g,{children:l.isPlaceholder?null:d(l.column.columnDef.header,l.getContext())},l.id))},a.id))}),e(u,{children:r.getRowModel().rows?.length?r.getRowModel().rows.map(a=>e(o,{"data-state":a.getIsSelected()&&"selected",children:a.getVisibleCells().map(l=>e(i,{children:d(l.column.columnDef.cell,l.getContext())},l.id))},a.id)):e(o,{children:e(i,{colSpan:t.length,className:"h-24 text-center",children:"No members found."})})})]})})}function j(){return[{accessorKey:"roleid",header:({column:r})=>e("div",{className:"text-center",children:s(n,{variant:"ghost",onClick:()=>r.toggleSorting(r.getIsSorted()==="asc"),children:["Role ID",e(c,{className:"ml-2 h-4 w-4"})]})}),cell:({row:r})=>{const t=r.getValue("roleid");return e("div",{className:"text-center",children:e(p,{href:route("admin.manage-characters.show",t),className:"font-mono font-semibold text-primary hover:underline",children:t})})}},{accessorKey:"name",header:({column:r})=>e("div",{className:"text-center",children:s(n,{variant:"ghost",onClick:()=>r.toggleSorting(r.getIsSorted()==="asc"),children:["Character Name",e(c,{className:"ml-2 h-4 w-4"})]})}),cell:({row:r})=>e("div",{className:"text-center font-medium",children:r.getValue("name")})},{accessorKey:"role",header:({column:r})=>e("div",{className:"text-center",children:s(n,{variant:"ghost",onClick:()=>r.toggleSorting(r.getIsSorted()==="asc"),children:["Rank",e(c,{className:"ml-2 h-4 w-4"})]})}),cell:({row:r})=>{const t=r.getValue("role");return e(N,{role:t})}},{accessorKey:"cls",header:({column:r})=>e("div",{className:"text-center",children:s(n,{variant:"ghost",onClick:()=>r.toggleSorting(r.getIsSorted()==="asc"),children:["Class",e(c,{className:"ml-2 h-4 w-4"})]})}),cell:({row:r})=>{const t=r.getValue("cls");return s("div",{className:"flex items-center justify-center gap-2",children:[e(f,{classId:t,size:"sm"}),e("span",{className:"text-sm",children:x(t)})]})}},{accessorKey:"is_online",header:()=>e("div",{className:"text-center",children:"Status"}),cell:({row:r})=>{const t=r.getValue("is_online");return e("div",{className:"text-center",children:t?e("span",{className:"text-green-600 dark:text-green-400 font-medium",children:"Online"}):e("span",{className:"text-red-600 dark:text-red-400 font-medium",children:"Offline"})})}}]}export{M as MemberTable,j as createMemberColumns};
