From 7a56e912a2f4f2fd1e1071968a603c85e87e3cec Mon Sep 17 00:00:00 2001 From: Leo dev Date: Tue, 26 Aug 2025 00:18:17 +0200 Subject: [PATCH] Channels & basic structure --- src/app/server/[id]/page.tsx | 21 +++++++++++++++++++++ src/components/Sidebar.tsx | 21 ++++++++++++++++----- src/types/Server.ts | 11 +++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 src/app/server/[id]/page.tsx create mode 100644 src/types/Server.ts diff --git a/src/app/server/[id]/page.tsx b/src/app/server/[id]/page.tsx new file mode 100644 index 0000000..34853fe --- /dev/null +++ b/src/app/server/[id]/page.tsx @@ -0,0 +1,21 @@ +import AppSidebar from "@/components/Sidebar"; +import { Button } from "@/components/ui/button"; + +export default async function Server(params: {params: Promise<{ id: string }>}) { + const { id } = await params.params; + + return ( + + + + ); +} diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 4f5e715..51751f1 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -3,27 +3,29 @@ import { SidebarContent, SidebarFooter, SidebarHeader, - SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, } from "./ui/sidebar"; -import { ChevronDown } from "lucide-react"; +import { ChevronDown, HashIcon, MicIcon, SpeakerIcon } from "lucide-react"; import { DropdownMenuItem, DropdownMenu, DropdownMenuContent, DropdownMenuTrigger, } from "./ui/dropdown-menu"; +import Server from "@/types/Server"; export default function AppSidebar({ + server, children, }: Readonly<{ + server?: Server; children: React.ReactNode; }>) { return ( - + server ? @@ -48,8 +50,17 @@ export default function AppSidebar({ + + {server.channels.map((channel) => ( + + {channel.kind === 'voice' ? : } + {channel.name} + + ))} + - {children} - + {children} + : + children ); } diff --git a/src/types/Server.ts b/src/types/Server.ts new file mode 100644 index 0000000..9688b9a --- /dev/null +++ b/src/types/Server.ts @@ -0,0 +1,11 @@ +export interface Channel { + id: string; + name: string; + kind: "text" | "voice"; +} + +export default interface Server { + id: string; + name: string; + channels: Channel[]; +} \ No newline at end of file