input area

This commit is contained in:
ari committed 2022-06-16 17:24:31 -04:00
1 parent 0fc3ea6146
commit 15c97b81b4
16 files changed
+699 -416

No files matched your search

@@ -0,0 +1,25 @@
import { FC } from "react";
import {
InputAutoComplete,
InputAutoCompletePropsBase,
} from "./InputAutoComplete";
import { useHAAreas } from "haService/AreaRegistry";
export type InputAreaProps = InputAutoCompletePropsBase & {
restrictToDomain?: string[];
};
export const InputArea: FC<InputAreaProps> = (props) => {
// state
const areas = useHAAreas();
return (
<InputAutoComplete
{...props}
validateOption={(v) => areas.validateOptions(v, props.restrictToDomain)}
options={areas.getOptions(props.restrictToDomain)}
getID={areas.getID}
getLabel={areas.getLabel}
onlyShowLabel
/>
);
};