import{a as p}from"./chunk-NAEHKFOZ.mjs";import{a as h}from"./chunk-KY323GRB.mjs";import{b as d}from"./chunk-NQHWNGH7.mjs";import{useCurrentProfile as P}from"@baseapp-frontend/authentication";import{AvatarWithPlaceholder as S}from"@baseapp-frontend/design-system/components/web/avatars";import{LoadingButton as L}from"@mui/lab";import{Box as T,Typography as v}from"@mui/material";import{ConnectionHandler as g,useFragment as w}from"react-relay";import{jsx as f,jsxs as C}from"react/jsx-runtime";function I(t,e){return M(t)||R(t,e)||j(t,e)||A()}function A(){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 j(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,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,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=(n=s.call(r)).done)&&(u.push(n.value),u.length!==e);o=!0);}catch(m){c=!0,i=m}finally{try{if(!o&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}function M(t){if(Array.isArray(t))return t}var F=function(e){var r=e.profile,n=e.onChatCreation,i=w(h,r),s=i.id,a=i.image,u=i.name,o=i.urlPath,c=d(),m=I(c,2),b=m[0],x=m[1],_=P(),l=_.currentProfile;return C(p,{children:[f(S,{width:48,height:48,src:a?.url,sx:{alignSelf:"center",justifySelf:"center"}}),C(T,{sx:{display:"grid",gridTemplateRows:"repeat(2, minmax(0, 1fr))"},children:[f(v,{variant:"subtitle2",children:u}),f(v,{variant:"caption",color:"text.secondary",children:o?.path&&"@".concat(o.path)})]}),f(L,{color:"inherit",variant:"outlined",size:"small",onClick:function(){l!=null&&l.id&&b({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:n})},loading:x,sx:{maxWidth:"fit-content",justifySelf:"end"},children:"Message"})]},"chat-room-item-".concat(s))},$=F;export{$ as a};
//# sourceMappingURL=chunk-A6BTMZPH.mjs.map