aboutsummaryrefslogtreecommitdiff
path: root/components/membership.js
blob: 9f7b4c336e328590d501f90c4a6775eb46ed3db5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { html, Component } from "../lib/index.js";
import * as irc from "../lib/irc.js";

export default function Membership(props) {
	if (!this.props.value) {
		return null;
	}

	// XXX: If we were feeling creative we could generate unique colors for
	// each item in ISUPPORT CHANMODES. But I am not feeling creative.
	const name = irc.STD_MEMBERSHIP_NAMES[this.props.value[0]] || "";
	return html`
		<span class="membership ${name}" title=${name}>
			${this.props.value}
		</span>
	`;
}