import React, { useState } from "react"; import VideoGrid, { useVideoGridLayout, } from "matrix-react-sdk/src/components/views/voip/GroupCallView/VideoGrid"; import VideoTile from "matrix-react-sdk/src/components/views/voip/GroupCallView/VideoTile"; import "matrix-react-sdk/res/css/views/voip/GroupCallView/_VideoGrid.scss"; import { useMemo } from "react"; import { Button } from "../button"; export default { title: "VideoGrid", parameters: { layout: "fullscreen", }, }; export const ParticipantsTest = () => { const [layout, setLayout] = useVideoGridLayout(); const [participantCount, setParticipantCount] = useState(1); const items = useMemo( () => new Array(participantCount).fill(undefined).map((_, i) => ({ id: (i + 1).toString(), focused: false, presenter: false, })), [participantCount] ); return ( <>
{participantCount < 12 && ( )} {participantCount > 0 && ( )}
{({ item, ...rest }) => ( 2 || item.focused} {...rest} /> )}
); }; ParticipantsTest.args = { layout: "freedom", participantCount: 1, };