import { Lock, LockOpen } from "lucide-react";
import { openCallPage, useCall } from "../store";
import {
Button,
Card,
CardContent,
CardHeader,
Tooltip,
TooltipContent,
TooltipTrigger,
useIsMobile,
} from "@tensamin/ui";
import ScreenshareButton from "./buttons/screenshare";
import MuteButton from "./buttons/mute";
import DeafButton from "./buttons/deaf";
import { Room, Track } from "livekit-client";
import { useEffect, useState } from "react";
import { AreaChart, Area } from "recharts";
import LeaveButton from "./buttons/leave";
export default function SidebarBox() {
const state = useCall((store) => store.state);
const isMobile = useIsMobile();
return state === "closed" ? null : (
);
}
function ConnectionBar() {
const state = useCall((store) => store.state);
const isEncrypted = useCall((store) => store.isEncrypted);
const callId = useCall((store) => store.callId);
return (
openCallPage(callId || "")}
size="lg"
variant={
state === "open" && isEncrypted ? "subtleDefault" : "destructive"
}
className="flex justify-between items-center"
>
{state === "encrypting" && "Encrypting..."}
{state === "connecting" && "Connecting..."}
{state === "open" && "Connected"}
{state === "closed" && "Closed"}
{state === "closing" && "Closing"}
{isEncrypted ? (
) : (
)}
}
/>
Click to open call page
);
}
export function TinyPingGraph() {
const room = useCall((store) => store.room);
const [mapData, setMapData] = useState