/* Copyright 2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. */ import { forwardRef } from "react"; import { useObservableEagerState } from "observable-hooks"; import classNames from "classnames"; import { CallLayout } from "./CallLayout"; import { SpotlightLandscapeLayout as SpotlightLandscapeLayoutModel } from "../state/CallViewModel"; import styles from "./SpotlightLandscapeLayout.module.css"; import { useUpdateLayout } from "./Grid"; /** * An implementation of the "spotlight landscape" layout, in which the spotlight * tile takes up most of the space on the left, and the grid of participants is * shown as a scrolling rail on the right. */ export const makeSpotlightLandscapeLayout: CallLayout< SpotlightLandscapeLayoutModel > = ({ minBounds }) => ({ scrollingOnTop: false, fixed: forwardRef(function SpotlightLandscapeLayoutFixed( { model, Slot }, ref, ) { useUpdateLayout(); useObservableEagerState(minBounds); return (
); }), scrolling: forwardRef(function SpotlightLandscapeLayoutScrolling( { model, Slot }, ref, ) { useUpdateLayout(); useObservableEagerState(minBounds); const withIndicators = useObservableEagerState(model.spotlight.media).length > 1; return (
{model.grid.map((m) => ( ))}
); }), });