/* Copyright 2022-2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. */ import classNames from "classnames"; import { FC, HTMLAttributes, ReactNode, forwardRef } from "react"; import { Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { Heading, Text } from "@vector-im/compound-web"; import { UserProfileIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import styles from "./Header.module.css"; import Logo from "./icons/Logo.svg?react"; import { Avatar, Size } from "./Avatar"; import { EncryptionLock } from "./room/EncryptionLock"; import { useMediaQuery } from "./useMediaQuery"; interface HeaderProps extends HTMLAttributes { children: ReactNode; className?: string; } export const Header = forwardRef( ({ children, className, ...rest }, ref) => { return (
{children}
); }, ); Header.displayName = "Header"; interface LeftNavProps extends HTMLAttributes { children: ReactNode; className?: string; hideMobile?: boolean; } export const LeftNav: FC = ({ children, className, hideMobile, ...rest }) => { return (
{children}
); }; interface RightNavProps extends HTMLAttributes { children?: ReactNode; className?: string; hideMobile?: boolean; } export const RightNav: FC = ({ children, className, hideMobile, ...rest }) => { return (
{children}
); }; interface HeaderLogoProps { className?: string; } export const HeaderLogo: FC = ({ className }) => { const { t } = useTranslation(); return ( ); }; interface RoomHeaderInfoProps { id: string; name: string; avatarUrl: string | null; encrypted: boolean; participantCount: number | null; } export const RoomHeaderInfo: FC = ({ id, name, avatarUrl, encrypted, participantCount, }) => { const { t } = useTranslation(); const size = useMediaQuery("(max-width: 550px)") ? "sm" : "lg"; return (
{name}
{(participantCount ?? 0) > 0 && (
{t("participant_count", { count: participantCount ?? 0 })}
)}
); };