import{t as l,j as e}from"./index-B-YXshIJ.js";import{d as u}from"./default-profile-pic-B1WNOWFq.js";import{I as p}from"./InfoBox-XHysCRaX.js";const y=()=>{var d,n,c,i,m;const o=l.auth.verifySession.useQuery().data,t=o?l.organization.getOrganizationsForUser.useQuery({userEmail:o.email}):null,r=localStorage.getItem("currentOrganization"),s=r?JSON.parse(r).value:t!=null&&t.data&&((d=t==null?void 0:t.data)==null?void 0:d.length)<0?t==null?void 0:t.data[0]._id.toString():null,a=s?l.organization.getCurrentOrganizationDetails.useQuery({orgId:s}):null;return!(t!=null&&t.data)||t!=null&&t.data&&((n=t==null?void 0:t.data)==null?void 0:n.length)<1?e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-gray-900 text-2xl font-semibold",children:"Collaborators"}),e.jsx("hr",{className:"my-2"}),e.jsx(p,{className:"mt-4 bg-purple-100",infoIconColorClass:"text-purple-900",children:e.jsx("p",{children:'You are not part of any organization. Please contact your organization owner to add you to an organization. If you are the owner, please create an organization by by clicking on the "Add new organization" button at the top right corner.'})})]}):e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("h3",{className:"text-gray-900 text-2xl font-semibold",children:["Collaborators for ",(c=a==null?void 0:a.data)==null?void 0:c.name]}),e.jsx("hr",{className:"my-2"}),e.jsx("p",{className:"mb-4",children:"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel obcaecati repudiandae illum quidem doloremque. Porro voluptas asperiores, tempora eos voluptatibus eveniet corrupti. Distinctio aliquam eligendi consequatur? Harum iste quam dolorem."}),e.jsx("h3",{className:"font-bold text-gray-900",children:"Owner"}),e.jsx("hr",{className:"my-2"}),e.jsxs("h3",{className:"font-bold text-purple-900 mb-4 flex items-center",children:[e.jsx("img",{className:"h-10 w-10 rounded-full",src:u,alt:"User Avatar"}),e.jsx("span",{className:"ml-4",children:(i=a==null?void 0:a.data)==null?void 0:i.createdBy.email})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-bold text-gray-900",children:"All"}),e.jsx("button",{className:"bg-purple-950 rounded-md px-4 py-1 text-white font-medium cursor-pointer",children:"Add User"})]}),e.jsx("hr",{className:"my-2"}),e.jsx("div",{className:"flex flex-col",children:(m=a==null?void 0:a.data)==null?void 0:m.users.map(x=>e.jsxs("div",{className:"cursor-pointer flex flex-row item-center justify-between p-2 border rounded border-gray-400 hover:border-purple-950",children:[e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx("img",{className:"h-10 w-10 rounded-full",src:u,alt:"User Avatar"}),e.jsx("p",{className:"font-normal text-gray-900 px-4",children:x.email})]}),e.jsx("button",{className:" rounded-md px-4 py-1 text-red-600 font-normal cursor-pointer",children:"Remove"})]},x.id.toString()))})]})};export{y as default};
