import{r as e,j as s,M as a}from"./vendor--leCAzSo.js";import{N as o,G as t,J as n}from"./index-DZuQva-j.js";import"./c723dd3dd-58n3MxoB.js";import"./ca9c256b9-7brFE8T2.js";import"./c57c2877c-dpgWZiV5.js";import"./cb5cdda9a-CSfiLIa6.js";import"./c51e217b4-KUwQQl_W.js";import"./tree-sitter-BFuuT2ac.js";const r=e.memo(({onDismiss:r,onAction:i})=>{const{data:c}=o(!0),[l,m]=e.useState(!1),u=c?.organizations?.filter(e=>!e.has_pending_request)??[],d=u.length>0,j=e.useRef(!1),p=e.useCallback(()=>{j.current=!0,m(!0)},[]),g=e.useCallback(()=>{m(!1),j.current&&i()},[i]);if(!d&&!l)return null;const f=1===u.length?u[0]:null;return s.jsxs(s.Fragment,{children:[u.length>0&&s.jsx(t,{message:f?s.jsx(a,{defaultMessage:"{orgName} is on Claude. Join your team to share projects and chats.",id:"7U3S+cHC20",values:{orgName:s.jsx("strong",{children:f.name})}}):s.jsx(a,{defaultMessage:"{count, plural, one {# team from your company is on Claude.} other {# teams from your company are on Claude.}}",id:"rCfcYOkcYs",values:{count:u.length}}),button:{children:f?s.jsx(a,{defaultMessage:"Request to join",id:"CVbwp6HiQE"}):s.jsx(a,{defaultMessage:"View teams",id:"bY1U+Iziei"}),onClick:p},onDismiss:r}),s.jsx(n,{isOpen:l,onClose:g})]})});r.displayName="JoinDiscoverableOrgBanner";export{r as JoinDiscoverableOrgBanner};
