refactor inputs
This commit is contained in:
1 parent
2c5d64ab86
commit
549f52655b
45 files changed
+301
-256
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { FC } from "react";
|
||||
import { useHADeviceRegistry } from "haService";
|
||||
import {
|
||||
InputAutoComplete,
|
||||
InputAutoCompletePropsBase,
|
||||
} from "./InputAutoComplete";
|
||||
|
||||
export type InputDeviceProps = InputAutoCompletePropsBase;
|
||||
|
||||
export const InputDevice: FC<InputDeviceProps> = (props) => {
|
||||
// state
|
||||
const dr = useHADeviceRegistry();
|
||||
return (
|
||||
<InputAutoComplete
|
||||
{...props}
|
||||
label={props.label ?? "Device"}
|
||||
getID={dr.getID}
|
||||
getLabel={dr.getLabel}
|
||||
options={dr.getOptions()}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user