1import{j as e,r as p}from"./ui-vendor-Da9uQuMW.js";import{aQ as f,aR as g,B as j,x as d,U as b,Y as y,X as v,J as N,a9 as T,ax as S,y as _}from"./App-B1QN_3sS.js";import{B as k}from"./separator-CcGBAGgT.js";import{T as w,a as M,b as x,c as h}from"./tabs-BqByVUA8.js";import{p as m,q as P,d as L}from"./use-teams-BDmiO-rK.js";import R from"./file-headphone-CajZKF0V.js";import{u as C}from"./utils-DxXc-Znk.js";import"./index-CmeDnPm-.js";import"./icons-dynamic-vendor-Cqq8S-fy.js";import"./triangle-alert-DXdl2qp5.js";import"./charts-vendor-DWyOgyj2.js";import"./team.service-BVSuLLCG.js";function z(s){return s.split(" ").map(a=>a[0]).slice(0,2).join("").toUpperCase()}function B({share:s,direction:a}){const[t,i]=p.useState(!1),n=P({onSuccess:()=>i(!1)}),r=a==="by_others"?`/app/meetings/${s.meeting_id}/shared-view`:`/app/meetings/${s.meeting_id}`;return e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border p-3",children:[e.jsxs(b,{to:r,className:"flex min-w-0 flex-1 items-center gap-3 hover:opacity-80",children:[e.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e.jsx(R,{className:"size-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.meeting_title||"Untitled meeting"}),e.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Meeting note · ",y(s.created_at).format("D MMM YYYY, h:mm A")]})]})]}),a==="by_me"&&e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",size:"icon",className:"size-8 shrink-0 text-muted-foreground hover:text-destructive","aria-label":"Revoke share",onClick:()=>i(!0),children:e.jsx(v,{className:"size-4"})}),e.jsx(N,{open:t,onOpenChange:i,title:"Revoke this share?",description:`This removes "${s.meeting_title||"this meeting"}" from their Shared list immediately.`,confirmLabel:"Revoke",pendingLabel:"Revoking...",isPending:n.isPending,onConfirm:()=>n.mutate(s.id)})]})]})}function u({direction:s,groupId:a,otherUserId:t}){const{data:i,isLoading:n}=m(s,a,t),r=i?.shares??[];return n?e.jsxs("div",{className:"space-y-2 py-3",children:[e.jsx(d,{className:"h-14 w-full"}),e.jsx(d,{className:"h-14 w-full"})]}):r.length===0?e.jsx("p",{className:"rounded-lg border border-dashed p-6 text-center text-xs text-muted-foreground",children:"Nothing shared here yet."}):e.jsx("div",{className:"flex flex-col gap-2",children:r.map(l=>e.jsx(B,{share:l,direction:s},l.id))})}function Y({groupId:s,otherUserId:a,otherName:t}){const{data:i}=m("by_others",s,a),{data:n}=m("by_me",s,a),r=i?.total??0,l=n?.total??0,o=r+l;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(f,{className:"size-10",children:e.jsx(g,{children:z(t)})}),e.jsxs("h2",{className:"text-lg font-semibold",children:["You â ",t]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(j,{variant:"secondary",className:"text-xs",children:[o," ",o===1?"meeting":"meetings"," shared"]})})]}),e.jsxs(w,{defaultValue:"by-them",className:"w-full",children:[e.jsxs(M,{className:"w-full justify-start overflow-x-auto sm:w-fit",children:[e.jsxs(x,{value:"by-them",className:"gap-1.5",children:["Shared by ",t,r>0&&` (${r})`]}),e.jsxs(x,{value:"by-you",className:"gap-1.5",children:["Shared by you",l>0&&` (${l})`]})]}),e.jsx(h,{value:"by-them",className:"pt-2",children:e.jsx(u,{direction:"by_others",groupId:s,otherUserId:a})}),e.jsx(h,{value:"by-you",className:"pt-2",children:e.jsx(u,{direction:"by_me",groupId:s,otherUserId:a})})]})]})}function X(){const{groupId:s,otherUserId:a}=T(),t=S(),{setBreadcrumbs:i}=_(),n=t.state?.partnerName,{data:r}=L(),l=r?.partners.find(c=>c.group_id===s&&c.other_user_id===a),o=n||l?.other_name||"Team member";return C(o),p.useEffect(()=>{i([{label:"Teams",to:"/app/teams"},{label:"Shared",to:"/app/teams"},{label:o,to:t.pathname,isLast:!0}])},[i,o,t.pathname]),!s||!a?null:e.jsx("div",{className:"mx-auto flex w-full flex-col gap-4 px-4 py-3.5 pb-6",children:e.jsx(Y,{groupId:s,otherUserId:a,otherName:o})})}export{X as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.