${this.showDetails && this.conversation && this.user
? html`
${this.isChatRoom()
? html`
this.handleAvatarUploaded(e.detail.blob)}
.accept=${"image/*"}
.label=${msg("Select picture")}
>
${this.conversation.avatar_url
? html``
: html``}
${this.conversation.avatar_url
? html` this.clearAvatar()}
>${msg("Remove picture")}
`
: nothing}
`
: html`
`}
${this.isChatRoom()
? html`
{
this.conversationTitleInput = (e.target as HTMLInputElement).value;
}}
@keyup=${inputBlurOnEnter}
@blur=${() => this.handleSaveConversationName()}
/>
${msg("Changing the name of a group chat changes it for everyone.")}
${membersData
? html`
${membersData.data?.map(
(member) => html`
${member.name}
${member.is_blocked
? html``
: nothing}
${member.access === AccessType.Admin
? html` `
: nothing}
${this.user &&
this.user.id === member.id &&
!hasPermission(PermissionType.Admin, this.conversation?.permissions)
? html` this.leaveConversation(member.id)}
title=${msg("Leave conversation")}
kind="icon"
>
`
: hasPermission(PermissionType.Admin, this.conversation?.permissions)
? html`
this.leaveConversation(member.id)}
>
${this.user && this.user.id === member.id
? msg("Leave conversation")
: msg("Remove member")}
${adminCount > 1 && member.access === AccessType.Admin
? html`
this.updateMember(member.id, AccessType.Write)}
>
${msg("Remove as admin")}
`
: member.access !== AccessType.Admin
? html`
this.updateMember(member.id, AccessType.Admin)}
>
${msg("Make admin")}
`
: nothing}
`
: nothing}
`
) ?? nothing}
`
: nothing}
`
: nothing}
`
: nothing}