Global search waits for selection before submitting.

This commit is contained in:
Roland 2024-01-01 15:16:03 -07:00
parent 377c69e8a7
commit 3ad7b8af00
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
9 changed files with 141 additions and 169 deletions

View file

@ -287,10 +287,10 @@ const ZimsRefreshWarning = () => {
</Message>;
}
export const ZimSearchView = ({estimates, loading}) => {
export const ZimSearchView = ({suggestions, loading}) => {
const [activeIndex, setActiveIndex] = React.useState(null);
const {searchStr, activeTags, setTags} = useSearch();
const {zimsEstimates} = estimates;
const {zimsEstimates} = suggestions;
const handleClick = (index, activeIndex_) => {
setActiveIndex(index === activeIndex_ ? -1 : index);
@ -308,7 +308,11 @@ export const ZimSearchView = ({estimates, loading}) => {
onClick={handleClick}
/>);
} else if (loading) {
body = <Loader active={true}/>;
body = <AccordionContent>
<Segment placeholder>
<Loader active={true}/>
</Segment>
</AccordionContent>;
} else if (_.isEmpty(zimsEstimates)) {
body = <ZimsRefreshWarning/>;
}