summaryrefslogtreecommitdiff
path: root/ui/lib/components/Channel.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'ui/lib/components/Channel.svelte')
-rw-r--r--ui/lib/components/Channel.svelte21
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/lib/components/Channel.svelte b/ui/lib/components/Channel.svelte
new file mode 100644
index 0000000..97fea1f
--- /dev/null
+++ b/ui/lib/components/Channel.svelte
@@ -0,0 +1,21 @@
+<script>
+ import { activeChannel } from '$lib/store';
+
+ export let id;
+ export let name;
+ let active = false;
+
+ activeChannel.subscribe((value) => {
+ active = value.is(id);
+ });
+</script>
+
+<li
+ class="rounded-full"
+ class:bg-slate-400={active}
+>
+<a href="/ch/{id}">
+ <span class="badge bg-primary-500">#</span>
+ <span class="flex-auto">{name}</span>
+</a>
+</li>