2020-06-26 08:32:56 -04:00
|
|
|
import { html, Component } from "/lib/index.js";
|
|
|
|
|
|
|
|
function MemberItem(props) {
|
|
|
|
function handleClick(event) {
|
|
|
|
event.preventDefault();
|
|
|
|
props.onClick();
|
|
|
|
}
|
|
|
|
|
|
|
|
var url = "irc:///" + encodeURIComponent(props.nick) + ",isnick";
|
|
|
|
return html`
|
|
|
|
<li>
|
|
|
|
<a href=${url} class="nick" onClick=${handleClick}>${props.nick}</a>
|
|
|
|
</li>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function MemberList(props) {
|
|
|
|
return html`
|
2020-06-26 09:16:07 -04:00
|
|
|
<ul>
|
2020-07-09 17:24:32 -04:00
|
|
|
${Array.from(props.members.entries()).sort().map(([nick, membership]) => html`
|
2020-06-26 08:32:56 -04:00
|
|
|
<${MemberItem} key=${nick} nick=${nick} membership=${membership} onClick=${() => props.onNickClick(nick)}/>
|
|
|
|
`)}
|
|
|
|
</ul>
|
|
|
|
`;
|
|
|
|
}
|