19 lines
549 B
TypeScript
19 lines
549 B
TypeScript
import { FC } from "react";
|
|
import { useHADeviceRegistry } from 'haService';
|
|
import { InputAutoComplete, InputAutoCompletePropsBase } from './InputAutoComplete';
|
|
|
|
export type InputDeviceProps = InputAutoCompletePropsBase & { multiple?: false };
|
|
|
|
export const InputDevice: FC<InputDeviceProps> = props => {
|
|
// state
|
|
const dr = useHADeviceRegistry();
|
|
|
|
return <InputAutoComplete
|
|
{...props}
|
|
label={props.label ?? "Device ID"}
|
|
getID={dr.getID}
|
|
getLabel={dr.getLabel}
|
|
options={dr.getOptions()}
|
|
/>
|
|
}
|