import { useId, useRef } from "react"; import { useAnchoredPopover } from "../../components/living/use-anchored-popover"; import { Tooltip } from "../../components/living/Tooltip"; import { Glyph } from "../../ui/icons"; import { useCopy } from "../../ui/copy"; import { ChannelAction } from "./ChannelMedia"; export function ChannelJoinVoice({ joined, disabled, busy, onJoin }: { joined: boolean; disabled: boolean; busy: boolean; onJoin: (listenOnly: boolean) => void; }) { const { lang, vis } = useCopy(); const zh = lang === "zh"; const id = useId(); const trigger = useRef(null); const panel = useRef(null); useAnchoredPopover(trigger, panel, { side: "below", enabled: !joined }); if (joined) return {!vis && {zh ? "语音已加入" : "Voice joined"}}; return
onJoin(false)} />
; }