/* Copyright 2022-2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. */ import { ComponentPropsWithoutRef, FC } from "react"; import classNames from "classnames"; import { useTranslation } from "react-i18next"; import { Button as CpdButton, Tooltip } from "@vector-im/compound-web"; import { MicOnSolidIcon, MicOffSolidIcon, VideoCallSolidIcon, VideoCallOffSolidIcon, EndCallIcon, ShareScreenSolidIcon, SettingsSolidIcon, SwitchCameraSolidIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; import styles from "./Button.module.css"; interface MicButtonProps extends ComponentPropsWithoutRef<"button"> { muted: boolean; } export const MicButton: FC = ({ muted, ...props }) => { const { t } = useTranslation(); const Icon = muted ? MicOffSolidIcon : MicOnSolidIcon; const label = muted ? t("unmute_microphone_button_label") : t("mute_microphone_button_label"); return ( ); }; interface VideoButtonProps extends ComponentPropsWithoutRef<"button"> { muted: boolean; } export const VideoButton: FC = ({ muted, ...props }) => { const { t } = useTranslation(); const Icon = muted ? VideoCallOffSolidIcon : VideoCallSolidIcon; const label = muted ? t("start_video_button_label") : t("stop_video_button_label"); return ( ); }; export const SwitchCameraButton: FC> = ( props, ) => { const { t } = useTranslation(); return ( ); }; interface ShareScreenButtonProps extends ComponentPropsWithoutRef<"button"> { enabled: boolean; } export const ShareScreenButton: FC = ({ enabled, ...props }) => { const { t } = useTranslation(); const label = enabled ? t("stop_screenshare_button_label") : t("screenshare_button_label"); return ( ); }; export const EndCallButton: FC> = ({ className, ...props }) => { const { t } = useTranslation(); return ( ); }; export const SettingsButton: FC> = ( props, ) => { const { t } = useTranslation(); return ( ); };