import{_ as f}from"./AppLayout.vue_vue_type_script_setup_true_lang-C-UlPCqH.js";import{d as h,o as a,a as d,b as i,e as n,h as v,w as l,f as t,t as r,j as c,l as p,i as u,F as b,n as g,g as k,D as w}from"./app-D9-EssCM.js";import"./index-CcjNLu6f.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-MNmriUeS.js";import"./VisuallyHidden-DG35s1YI.js";import"./RovingFocusGroup-Diffidi3.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./x-DwmBYYXD.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const $={class:"p-4 space-y-6"},A={class:"rounded-lg bg-white border border-gray-200 p-6 shadow-sm"},C={class:"flex items-center justify-between"},D={class:"text-2xl font-bold text-gray-900"},j={key:0,class:"text-sm text-gray-500 mt-1"},N={class:"flex items-center gap-2"},T={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},B={class:"lg:col-span-2"},V={class:"rounded-lg bg-white border border-gray-200 shadow-sm"},M={class:"border-b border-gray-200 bg-gray-50 px-6 py-4"},S={class:"text-sm text-gray-600"},E={class:"p-6"},F={key:0,class:"text-center py-8 text-gray-500"},J={key:1,class:"space-y-3"},L={class:"inline-flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 text-sm font-semibold text-primary"},I={class:"text-sm font-medium text-gray-900"},U={key:0,class:"text-xs text-gray-500"},q={class:"space-y-6"},z={class:"rounded-lg bg-white border border-gray-200 shadow-sm"},G={class:"p-6 space-y-4"},H={class:"text-2xl font-bold text-primary"},K={class:"text-2xl font-bold text-primary"},O={class:"text-sm text-gray-900"},P={key:0,class:"rounded-lg bg-white border border-gray-200 shadow-sm"},Q={class:"p-6 space-y-3"},R={class:"text-sm font-medium text-gray-900"},W={class:"text-xs text-gray-500"},it=h({__name:"Show",props:{team:{}},setup(x){const e=x,y=m=>m?new Date(m).toLocaleDateString():"",_=()=>{confirm(`Are you sure you want to delete team "${e.team.name}"?`)&&w.delete(`/administration/teams/${e.team.id}`)};return(m,s)=>(a(),d(b,null,[i(n(v),{title:`Team: ${e.team.name}`},null,8,["title"]),i(f,{breadcrumbs:[{title:"Administration",href:"/administration"},{title:"Teams",href:"/administration/teams"},{title:e.team.name,href:"#"}]},{default:l(()=>[t("div",$,[t("div",A,[t("div",C,[t("div",null,[t("h1",D,r(e.team.name),1),e.team.description?(a(),d("p",j,r(e.team.description),1)):c("",!0)]),t("div",N,[i(n(p),{href:`/administration/teams/${e.team.id}/edit`,class:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90"},{default:l(()=>[...s[0]||(s[0]=[u(" Edit ",-1)])]),_:1},8,["href"]),t("button",{onClick:_,class:"rounded-md border border-red-300 px-4 py-2 text-sm font-medium text-red-700 hover:bg-red-50"}," Delete ")])])]),t("div",T,[t("div",B,[t("div",V,[t("div",M,[s[1]||(s[1]=t("h2",{class:"text-lg font-semibold text-gray-900"},"Members",-1)),t("p",S,r(e.team.users_count)+" "+r(e.team.users_count===1?"member":"members"),1)]),t("div",E,[e.team.users.length===0?(a(),d("div",F,[s[3]||(s[3]=t("p",null,"No members assigned to this team yet.",-1)),i(n(p),{href:`/administration/teams/${e.team.id}/edit`,class:"mt-2 inline-block text-sm font-medium text-blue-600 hover:text-blue-800"},{default:l(()=>[...s[2]||(s[2]=[u(" Add Members ",-1)])]),_:1},8,["href"])])):(a(),d("div",J,[(a(!0),d(b,null,g(e.team.users,o=>(a(),d("div",{key:o.id,class:"flex items-center gap-3 rounded-lg border px-4 py-3"},[t("span",L,r(o.name.charAt(0).toUpperCase()),1),t("div",null,[t("p",I,r(o.name),1),o.email?(a(),d("p",U,r(o.email),1)):c("",!0)])]))),128))]))])])]),t("div",q,[t("div",z,[s[7]||(s[7]=t("div",{class:"border-b border-gray-200 bg-gray-50 px-6 py-4"},[t("h2",{class:"text-lg font-semibold text-gray-900"},"Team Info")],-1)),t("div",G,[t("div",null,[s[4]||(s[4]=t("label",{class:"block text-sm font-medium text-gray-700"},"Members",-1)),t("p",H,r(e.team.users_count),1)]),t("div",null,[s[5]||(s[5]=t("label",{class:"block text-sm font-medium text-gray-700"},"Assigned Jobcards",-1)),t("p",K,r(e.team.jobcards_count),1)]),t("div",null,[s[6]||(s[6]=t("label",{class:"block text-sm font-medium text-gray-700"},"Created",-1)),t("p",O,r(y(e.team.created_at)),1)])])]),e.team.jobcards&&e.team.jobcards.length>0?(a(),d("div",P,[s[8]||(s[8]=t("div",{class:"border-b border-gray-200 bg-gray-50 px-6 py-4"},[t("h2",{class:"text-lg font-semibold text-gray-900"},"Assigned Jobcards")],-1)),t("div",Q,[(a(!0),d(b,null,g(e.team.jobcards.slice(0,5),o=>(a(),k(n(p),{key:o.id,href:`/jobcards/${o.id}`,class:"block rounded-lg border px-4 py-3 hover:bg-gray-50 transition-colors"},{default:l(()=>[t("p",R,r(o.job_number),1),t("p",W,r(o.title)+" · "+r(o.customer?.name),1)]),_:2},1032,["href"]))),128))])])):c("",!0)])])])]),_:1},8,["breadcrumbs"])],64))}});export{it as default};
