2023-09-08 15:39:10 -04:00
|
|
|
/*
|
2024-09-06 10:22:13 +02:00
|
|
|
Copyright 2023, 2024 New Vector Ltd.
|
2023-09-08 15:39:10 -04:00
|
|
|
|
2025-02-18 17:59:58 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-06 10:22:13 +02:00
|
|
|
Please see LICENSE in the repository root for full details.
|
2023-09-08 15:39:10 -04:00
|
|
|
*/
|
|
|
|
|
|
2024-12-11 09:27:55 +00:00
|
|
|
import { type FC } from "react";
|
2023-09-08 15:39:10 -04:00
|
|
|
import { Tooltip } from "@vector-im/compound-web";
|
|
|
|
|
import { useTranslation } from "react-i18next";
|
2024-07-25 13:15:45 -04:00
|
|
|
import {
|
|
|
|
|
LockSolidIcon,
|
|
|
|
|
LockOffIcon,
|
|
|
|
|
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
2023-09-08 15:39:10 -04:00
|
|
|
|
|
|
|
|
import styles from "./EncryptionLock.module.css";
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
encrypted: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const EncryptionLock: FC<Props> = ({ encrypted }) => {
|
|
|
|
|
const { t } = useTranslation();
|
2024-02-01 14:19:35 -05:00
|
|
|
const Icon = encrypted ? LockSolidIcon : LockOffIcon;
|
2023-11-20 19:02:19 -05:00
|
|
|
const label = encrypted ? t("common.encrypted") : t("common.unencrypted");
|
2023-09-08 15:39:10 -04:00
|
|
|
|
|
|
|
|
return (
|
2024-08-02 15:27:49 -04:00
|
|
|
<Tooltip label={label} placement="right" isTriggerInteractive={false}>
|
2023-09-08 15:39:10 -04:00
|
|
|
<Icon
|
|
|
|
|
width={16}
|
|
|
|
|
height={16}
|
|
|
|
|
className={styles.lock}
|
|
|
|
|
data-encrypted={encrypted}
|
|
|
|
|
/>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
);
|
|
|
|
|
};
|