diff --git a/apps/web/components/app-shell.tsx b/apps/web/components/app-shell.tsx deleted file mode 100644 index b0cd9f7..0000000 --- a/apps/web/components/app-shell.tsx +++ /dev/null @@ -1,597 +0,0 @@ -"use client"; - -import Image from "next/image"; -import Link from "next/link"; -import { usePathname, useRouter } from "next/navigation"; -import { useEffect, useState, type ReactNode } from "react"; -import { - Bell, - Bookmark, - ChevronDown, - ChevronLeft, - ChevronRight, - CircleCheck, - Hash, - House, - ListTodo, - LogOut, - Menu, - Moon, - PanelRightOpen, - Search, - Settings, - SquarePen, - Sun, - X, -} from "lucide-react"; -import { authClient } from "@muster/auth/client"; -import { Avatar } from "@/components/ui/avatar"; -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; -import { CommandPalette } from "@/components/command-palette"; -import { - demoDirectRooms, - demoMode, - demoOrganisation, - demoRooms, -} from "@/lib/demo-data"; -import { cn } from "@/lib/utils"; - -type NavigationRoom = { - id: string; - slug: string; - displayName: string; - topic: string; - roomType: string; - favourite: boolean | null; - muted: boolean | null; - sidebarPosition: number | null; - sidebarGroup: string | null; - unreadCount?: number; - mentionCount?: number; -}; - -const initialNavigationRooms: NavigationRoom[] = [ - ...demoRooms.map((room) => ({ - id: roomIdFromSlug(room.slug), - slug: room.slug, - displayName: room.name, - topic: room.topic, - roomType: "operations", - favourite: room.favourite, - muted: false, - sidebarPosition: 0, - sidebarGroup: null, - unreadCount: room.unread, - mentionCount: room.mentions, - })), - ...demoDirectRooms.map((room) => ({ - id: roomIdFromSlug(room.slug), - slug: room.slug, - displayName: room.name, - topic: room.topic, - roomType: "direct", - favourite: false, - muted: false, - sidebarPosition: 0, - sidebarGroup: null, - unreadCount: 0, - mentionCount: 0, - })), -]; - -function roomIdFromSlug(slug: string) { - return `demo:${slug}`; -} - -function initials(name: string) { - return name - .split(/\s+/) - .slice(0, 2) - .map((part) => part[0] ?? "") - .join("") - .toUpperCase(); -} - -function NavGroup({ label, children }: { label: string; children: ReactNode }) { - const [expanded, setExpanded] = useState(true); - return ( -
- - {expanded &&
{children}
} -
- ); -} - -function ChannelLink({ - room, - onNavigate, -}: { - room: NavigationRoom; - onNavigate: (() => void) | undefined; -}) { - const pathname = usePathname(); - const active = pathname === `/rooms/${room.slug}`; - return ( - -