mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
29 lines
685 B
TypeScript
29 lines
685 B
TypeScript
import React from "react";
|
|
import Dropdown, { Option } from "react-dropdown";
|
|
import "react-dropdown/style.css";
|
|
|
|
const AudioInputsDropdown: React.FC<{
|
|
audioDevices: Option[];
|
|
disabled: boolean;
|
|
hide: () => void;
|
|
deviceId: string;
|
|
setDeviceId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
}> = (props) => {
|
|
const handleDropdownChange = (option: Option) => {
|
|
props.setDeviceId(option.value);
|
|
props.hide();
|
|
};
|
|
|
|
return (
|
|
<Dropdown
|
|
options={props.audioDevices}
|
|
onChange={handleDropdownChange}
|
|
value={props.deviceId}
|
|
className="flex-grow w-full"
|
|
disabled={props.disabled}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default AudioInputsDropdown;
|