thelounge/client/components/Special/ListChannels.vue

37 lines
1,012 B
Vue
Raw Normal View History

2018-07-10 11:37:48 +02:00
<template>
2018-07-10 11:40:55 +02:00
<span v-if="channel.data.text">{{ channel.data.text }}</span>
2019-07-17 11:33:59 +02:00
<table v-else class="channel-list">
2018-07-10 11:37:48 +02:00
<thead>
<tr>
<th class="channel">Channel</th>
<th class="users">Users</th>
<th class="topic">Topic</th>
</tr>
</thead>
<tbody>
2019-07-17 11:33:59 +02:00
<tr v-for="chan in channel.data" :key="chan.channel">
<td class="channel"><ParsedMessage :network="network" :text="chan.channel" /></td>
2018-07-10 11:37:48 +02:00
<td class="users">{{ chan.num_users }}</td>
2019-07-17 11:33:59 +02:00
<td class="topic"><ParsedMessage :network="network" :text="chan.topic" /></td>
2018-07-10 11:37:48 +02:00
</tr>
</tbody>
</table>
</template>
<script lang="ts">
import {defineComponent, PropType} from "vue";
import {ClientChan, ClientNetwork} from "../../js/types";
2018-07-12 10:41:40 +02:00
import ParsedMessage from "../ParsedMessage.vue";
export default defineComponent({
2018-07-10 11:37:48 +02:00
name: "ListChannels",
2018-07-12 10:41:40 +02:00
components: {
ParsedMessage,
},
2018-07-10 11:37:48 +02:00
props: {
network: {type: Object as PropType<ClientNetwork>, required: true},
channel: {type: Object as PropType<ClientChan>, required: true},
2018-07-10 11:37:48 +02:00
},
});
2018-07-10 11:37:48 +02:00
</script>