import{a as p}from"./chunk-NAEHKFOZ.mjs";import{a as h}from"./chunk-KY323GRB.mjs";import{b as d}from"./chunk-SQFWWN4R.mjs";import{useCurrentProfile as M}from"@baseapp-frontend/authentication";import{AvatarWithPlaceholder as P}from"@baseapp-frontend/design-system/components/web/avatars";import{TypographyWithEllipsis as S}from"@baseapp-frontend/design-system/components/web/typographies";import{LoadingButton as T}from"@mui/lab";import{Box as L,Typography as w}from"@mui/material";import{ConnectionHandler as g,useFragment as F}from"react-relay";import{jsx as f,jsxs as v}from"react/jsx-runtime";function _(t,e){return R(t)||j(t,e)||A(t,e)||I()}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(t,e){if(t){if(typeof t=="string")return y(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function j(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var i,n,s,a,u=[],o=!0,c=!1;try{if(s=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;o=!1}else for(;!(o=(i=s.call(r)).done)&&(u.push(i.value),u.length!==e);o=!0);}catch(m){c=!0,n=m}finally{try{if(!o&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw n}}return u}}function R(t){if(Array.isArray(t))return t}var W=function(e){var r=e.profile,i=e.onChatCreation,n=F(h,r),s=n.id,a=n.image,u=n.name,o=n.urlPath,c=d(),m=_(c,2),C=m[0],b=m[1],x=M(),l=x.currentProfile;return v(p,{children:[f(P,{width:48,height:48,src:a?.url,sx:{alignSelf:"center",justifySelf:"center"}}),v(L,{sx:{display:"grid",gridTemplateRows:"repeat(2, minmax(0, 1fr))"},children:[f(S,{variant:"subtitle2",children:u}),f(w,{variant:"caption",color:"text.secondary",children:o?.path&&"@".concat(o.path)})]}),f(T,{color:"inherit",variant:"outlined",size:"small",onClick:function(){l!=null&&l.id&&C({variables:{input:{profileId:l.id,participants:[s]},connections:[g.getConnectionID(l.id,"roomsList_chatRooms",{unreadMessages:!1,archived:!1,q:""}),g.getConnectionID(l.id,"roomsList_chatRooms",{unreadMessages:!0,archived:!1,q:""})]},onCompleted:i})},loading:b,sx:{maxWidth:"fit-content",justifySelf:"end"},children:"Message"})]},"chat-room-item-".concat(s))},J=W;export{J as a};
//# sourceMappingURL=chunk-QAJTLA7I.mjs.map