/* Copyright 2024 New Vector Ltd. SPDX-License-Identifier: AGPL-3.0-only Please see LICENSE in the repository root for full details. */ import { ChangeEvent, FC, useCallback, useId } from "react"; import { Heading, InlineField, Label, RadioControl, Separator, } from "@vector-im/compound-web"; import { MediaDevice } from "../livekit/MediaDevicesContext"; import styles from "./DeviceSelection.module.css"; interface Props { devices: MediaDevice; caption: string; } export const DeviceSelection: FC = ({ devices, caption }) => { const groupId = useId(); const onChange = useCallback( (e: ChangeEvent) => { devices.select(e.target.value); }, [devices], ); if (devices.available.length == 0) return null; return (
{caption}
{devices.available.map(({ deviceId, label }, index) => ( } > ))}
); };