import{_ as p}from"./ListTableActionLabel.vue_vue_type_script_setup_true_lang-BIAl7X25.js";import{C as g,_ as b}from"./AppLayout.vue_vue_type_script_setup_true_lang-BwuDxc8O.js";import{d as y,o as a,a as n,b as e,e as s,h as v,w as i,f as t,l as m,i as l,F as f,n as w,t as d,j,D as k}from"./app-bWy6VYs1.js";import{U as x}from"./users-round-DdwfGnWm.js";import{U as C}from"./user-LMeqK21U.js";import{E as T}from"./eye-C6fH235p.js";import{S as $}from"./square-pen-VTID55Gt.js";import{T as N}from"./trash-2-zinYW52R.js";import"./index-C32fBP6Q.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-Cx2E44RD.js";import"./VisuallyHidden-0BfmsMPn.js";import"./RovingFocusGroup-D20OvR_w.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const V={class:"p-4"},E={class:"flex items-center justify-between gap-3 mb-6"},U={key:0,class:"bg-white rounded-lg border p-12 text-center"},B={key:1,class:"grid gap-4 md:grid-cols-2 lg:grid-cols-3"},D={class:"p-6"},F={class:"flex items-start justify-between"},S={class:"text-lg font-semibold text-gray-900"},A={key:0,class:"mt-1 text-sm text-gray-500 line-clamp-2"},L={class:"rounded-full bg-primary/10 p-2"},q={class:"mt-4 flex items-center gap-4 text-sm text-gray-600"},z={class:"flex items-center gap-1"},I={class:"flex items-center gap-1"},P={class:"border-t px-6 py-3 flex flex-wrap items-center gap-2"},R=["onClick"],ie=y({__name:"Index",props:{teams:{}},setup(h){const u=h,_=c=>{confirm(`Are you sure you want to delete team "${c.name}"?`)&&k.delete(`/administration/teams/${c.id}`)};return(c,o)=>(a(),n(f,null,[e(s(v),{title:"Teams"}),e(b,{breadcrumbs:[{title:"Administration",href:"/administration"},{title:"Teams",href:"#"}]},{default:i(()=>[t("div",V,[t("div",E,[o[1]||(o[1]=t("h1",{class:"text-2xl font-bold text-gray-900"},"Teams",-1)),e(s(m),{href:"/administration/teams/create",class:"rounded bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"},{default:i(()=>[...o[0]||(o[0]=[l(" New Team ",-1)])]),_:1})]),u.teams.length===0?(a(),n("div",U,[e(s(x),{class:"mx-auto h-12 w-12 text-gray-400"}),o[3]||(o[3]=t("h3",{class:"mt-4 text-lg font-medium text-gray-900"},"No teams yet",-1)),o[4]||(o[4]=t("p",{class:"mt-2 text-sm text-gray-500"},"Create a team to organize your users and assign jobcards.",-1)),e(s(m),{href:"/administration/teams/create",class:"mt-4 inline-block rounded bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors"},{default:i(()=>[...o[2]||(o[2]=[l(" Create First Team ",-1)])]),_:1})])):(a(),n("div",B,[(a(!0),n(f,null,w(u.teams,r=>(a(),n("div",{key:r.id,class:"bg-white rounded-lg border shadow-sm hover:shadow-md transition-shadow"},[t("div",D,[t("div",F,[t("div",null,[t("h3",S,d(r.name),1),r.description?(a(),n("p",A,d(r.description),1)):j("",!0)]),t("div",L,[e(s(x),{class:"h-5 w-5 text-primary"})])]),t("div",q,[t("span",z,[e(s(C),{class:"h-4 w-4"}),l(" "+d(r.users_count)+" "+d(r.users_count===1?"member":"members"),1)]),t("span",I,[e(s(g),{class:"h-4 w-4"}),l(" "+d(r.jobcards_count)+" "+d(r.jobcards_count===1?"jobcard":"jobcards"),1)])])]),t("div",P,[e(s(m),{href:`/administration/teams/${r.id}`,class:"inline-flex items-center justify-center rounded-md p-2 text-sm font-medium text-blue-600 hover:bg-blue-50 md:p-0 md:hover:bg-transparent hover:text-blue-800"},{default:i(()=>[e(p,{label:"View"},{default:i(()=>[e(s(T),{class:"h-4 w-4"})]),_:1})]),_:1},8,["href"]),e(s(m),{href:`/administration/teams/${r.id}/edit`,class:"inline-flex items-center justify-center rounded-md p-2 text-sm font-medium text-indigo-600 hover:bg-indigo-50 md:p-0 md:hover:bg-transparent hover:text-indigo-800"},{default:i(()=>[e(p,{label:"Edit"},{default:i(()=>[e(s($),{class:"h-4 w-4"})]),_:1})]),_:1},8,["href"]),t("button",{type:"button",onClick:G=>_(r),class:"inline-flex items-center justify-center rounded-md p-2 text-sm font-medium text-red-600 hover:bg-red-50 md:p-0 md:hover:bg-transparent hover:text-red-800"},[e(p,{label:"Delete"},{default:i(()=>[e(s(N),{class:"h-4 w-4"})]),_:1})],8,R)])]))),128))]))])]),_:1})],64))}});export{ie as default};
