uppy/packages/@uppy/audio/src/AudioSourceSelect.jsx
Antoine du Hamel 50f5f910b1
@uppy/audio: refactor to ESM (#3470)
npm package is still CommonJS, the plan is to switch that in the
next semver-major.
2022-03-09 11:29:39 +01:00

22 lines
626 B
JavaScript

import { h } from 'preact'
export default ({ currentDeviceId, audioSources, onChangeSource }) => {
return (
<div className="uppy-Audio-videoSource">
<select
className="uppy-u-reset uppy-Audio-audioSource-select"
onChange={(event) => { onChangeSource(event.target.value) }}
>
{audioSources.map((audioSource) => (
<option
key={audioSource.deviceId}
value={audioSource.deviceId}
selected={audioSource.deviceId === currentDeviceId}
>
{audioSource.label}
</option>
))}
</select>
</div>
)
}