"use client"; import { AlertCircle, RefreshCw } from "lucide-react"; import { useCallback, useEffect, useRef, useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Skeleton } from "@/components/ui/skeleton"; import { configApi, voiceApi } from "@/lib/api"; import type { Guild } from "@/lib/types"; export interface GuildSelectorProps { /** Currently selected guild ID */ value: string; /** Called when user selects a different guild */ onChange: (guildId: string) => void; /** If true, the bar is hidden when there's only one guild */ autoHide?: boolean; } /** * Guild selector bar — fetches the guild list and renders a v && onChange(v)}> {guilds.find((g) => g.id === value)?.name} {guilds.map((g) => ( {g.name} ))} ); }