/* Copyright 2021-2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ import { type Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import { PopOutIcon, ExpandIcon, PinSolidIcon, VoiceCallSolidIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../../languageHandler"; import RoomAvatar from "../../avatars/RoomAvatar"; import AccessibleButton from "../../elements/AccessibleButton"; interface LegacyCallControlsProps { onExpand?: () => void; onPin?: () => void; onMaximize?: () => void; } const LegacyCallViewHeaderControls: React.FC = ({ onExpand, onPin, onMaximize }) => { return (
{onMaximize && ( )} {onPin && ( )} {onExpand && ( )}
); }; interface ISecondaryCallInfoProps { callRoom: Room; } const SecondaryCallInfo: React.FC = ({ callRoom }) => { return ( {_t("voip|on_hold", { name: callRoom.name })} ); }; interface LegacyCallViewHeaderProps { pipMode?: boolean; callRooms: [Room, Room | null]; onPipMouseDown?: (event: React.MouseEvent) => void; onExpand?: () => void; onPin?: () => void; onMaximize?: () => void; } const LegacyCallViewHeader: React.FC = ({ pipMode = false, callRooms, onPipMouseDown, onExpand, onPin, onMaximize, }) => { const [callRoom, onHoldCallRoom] = callRooms; const callRoomName = callRoom.name; if (!pipMode) { return (
{_t("action|call")}
); } return (
{callRoomName}
{onHoldCallRoom && }
); }; export default LegacyCallViewHeader;