import * as React from "react"; import {ChannelEntry} from "../../channel-tree/channel"; const cssChannel = require("./channel.scss"); const cssTree = require("./tree.scss"); class ChannelIcon extends React.Component<{ channel: ChannelEntry }, {}> { channel_icon_classes() { const class_list = []; const channel = this.props.channel; if(channel.formattedChannelName() !== channel.channelName()) return "channel-spacer"; let icon_color; if(channel.properties.channel_flag_password && !channel.cached_password()) icon_color = "yellow"; else if(channel.properties.channel_flag_maxclients_unlimited && channel.clients().length >= channel.properties.channel_maxclients) icon_color = "red"; else if(channel.properties.channel_flag_maxfamilyclients_unlimited && channel.clients(true).length >= channel.properties.channel_maxfamilyclients) icon_color = "red"; else icon_color = "green"; return "channel-normal client-channel_" + icon_color + (channel.flag_subscribed ? "_subscribed" : ""); } render() { return
; } } class ChannelIcons extends React.Component<{channel: ChannelEntry}, {}> { render_icon(target: HTMLDivElement) { const props = this.props.channel.properties; if(!props.channel_icon_id) return; const tag = this.props.channel.channelTree.client.fileManager.icons.generateTag(props.channel_icon_id); tag.appendTo($(target)); } render() { const icons = []; const props = this.props.channel.properties; if(props.channel_flag_default) { icons.push(); } if(props.channel_flag_password) { icons.push(); } if(props.channel_codec_quality > 4) { icons.push(); } if(props.channel_needed_talk_power > 0) { icons.push(); } if(props.channel_icon_id != 0) { icons.push(