Add STATUSMSG indicator

Closes: https://todo.sr.ht/~emersion/gamja/65
This commit is contained in:
Simon Ser 2021-06-11 11:18:29 +02:00
parent d19f127952
commit ef50e62498
4 changed files with 49 additions and 4 deletions

24
components/membership.js Normal file
View file

@ -0,0 +1,24 @@
import { html, Component } from "../lib/index.js";
// XXX: If we were feeling creative we could generate unique colors for
// each item in ISUPPORT CHANMODES. But I am not feeling creative.
const names = {
"~": "owner",
"&": "admin",
"@": "op",
"%": "halfop",
"+": "voice",
};
export default function Membership(props) {
if (!this.props.value) {
return null;
}
const name = names[this.props.value[0]] || "";
return html`
<span class="membership ${name}" title=${name}>
${this.props.value}
</span>
`;
}