"use client"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Card, CardContent } from "@/components/ui/card"; import { ChevronsLeftRightEllipsisIcon, CloudDownloadIcon, Ellipsis, Home, UnplugIcon, } from "lucide-react"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui/tooltip"; import { Badge } from "@/components/ui/badge"; import { useWebsocket } from "@/hooks/use-websocket"; import { useTelegramAccount } from "@/hooks/use-telegram-account"; import { SettingsDialog } from "@/components/settings-dialog"; import prettyBytes from "pretty-bytes"; import ChatSelect from "@/components/chat-select"; import Link from "next/link"; import TelegramIcon from "@/components/telegram-icon"; import AutoDownloadDialog from "@/components/auto-download-dialog"; import useIsMobile from "@/hooks/use-is-mobile"; import { useState } from "react"; import { Button } from "@/components/ui/button"; export function Header() { const { isLoading, getAccounts, accountId, account, handleAccountChange } = useTelegramAccount(); const { connectionStatus, accountDownloadSpeed } = useWebsocket(); const accounts = getAccounts("active"); const isMobile = useIsMobile(); const [showMore, setShowMore] = useState(false); return (
{(!isMobile || showMore) && ( <> )}
{`${prettyBytes(accountDownloadSpeed, { bits: true })}/s`}

Current account download speed

{connectionStatus && ( {connectionStatus === "Open" ? ( ) : ( )} {connectionStatus}

WebSocket connection status

)}
); }