diff --git a/apps/desktop/src/components/channels/ChannelBrowser.svelte b/apps/desktop/src/components/channels/ChannelBrowser.svelte new file mode 100644 index 0000000..f866bf9 --- /dev/null +++ b/apps/desktop/src/components/channels/ChannelBrowser.svelte @@ -0,0 +1,135 @@ + + + + + + diff --git a/apps/desktop/src/components/channels/ChannelContextMenu.svelte b/apps/desktop/src/components/channels/ChannelContextMenu.svelte index 9c90608..135a241 100644 --- a/apps/desktop/src/components/channels/ChannelContextMenu.svelte +++ b/apps/desktop/src/components/channels/ChannelContextMenu.svelte @@ -2,17 +2,20 @@ import ChevronRight from "@lucide/svelte/icons/chevron-right"; import FolderInput from "@lucide/svelte/icons/folder-input"; import FolderOutput from "@lucide/svelte/icons/folder-output"; + import LogOut from "@lucide/svelte/icons/log-out"; import Pencil from "@lucide/svelte/icons/pencil"; import Trash2 from "@lucide/svelte/icons/trash-2"; - import type { ChannelGroup } from "@packages/api-client"; + import type { Channel, ChannelGroup } from "@packages/api-client"; interface Props { x: number; y: number; + channelType: Channel["type"]; currentGroupId: string | null; groups: ChannelGroup[]; onEdit: () => void; onDelete: () => void; + onLeave?: () => void; onMoveToGroup: (groupId: string | null) => void; onClose: () => void; } @@ -20,14 +23,18 @@ const { x, y, + channelType, currentGroupId, groups, onEdit, onDelete, + onLeave, onMoveToGroup, onClose, }: Props = $props(); + const canLeave = $derived(channelType !== "default"); + let showMoveSubmenu = $state(false); function handleEdit() { @@ -40,6 +47,11 @@ onClose(); } + function handleLeave() { + onLeave?.(); + onClose(); + } + function handleSelect(groupId: string | null) { onMoveToGroup(groupId); onClose(); @@ -129,6 +141,17 @@ {/if} + {#if canLeave} + + {/if} +