Files
element-call/src/room/EarpieceOverlay.tsx
T

45 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-06-26 05:08:57 -04:00
/*
Copyright 2025 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { type FC } from "react";
import { BigIcon, Button, Heading, Text } from "@vector-im/compound-web";
import { VoiceCallIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
2025-06-26 05:08:57 -04:00
import { useTranslation } from "react-i18next";
import styles from "./EarpieceOverlay.module.css";
interface Props {
show: boolean;
onBackToVideoPressed?: (() => void) | null;
}
export const EarpieceOverlay: FC<Props> = ({ show, onBackToVideoPressed }) => {
const { t } = useTranslation();
return (
<div className={styles.overlay} data-show={show} aria-hidden={!show}>
2025-06-26 05:08:57 -04:00
<BigIcon className={styles.icon}>
<VoiceCallIcon aria-hidden />
2025-06-26 05:08:57 -04:00
</BigIcon>
<Heading as="h2" weight="semibold" size="md">
{t("handset.overlay_title")}
2025-06-26 05:08:57 -04:00
</Heading>
<Text>{t("handset.overlay_description")}</Text>
2025-06-26 05:08:57 -04:00
<Button
kind="primary"
size="md"
2025-06-26 05:08:57 -04:00
onClick={() => {
onBackToVideoPressed?.();
}}
>
{t("handset.overlay_back_button")}
2025-06-26 05:08:57 -04:00
</Button>
{/* This spacer is used to give the overlay an offset to the top. */}
<div className={styles.spacer} />
2025-06-26 05:08:57 -04:00
</div>
);
};