import React, { type HTMLAttributes } from 'react'
import { List, useSearch } from '../..'
export interface SearchAutoCompleteProps
extends HTMLAttributes {
/**
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
*/
testId?: string
}
const SearchAutoComplete = ({
testId = 'fs-search-auto-complete',
children,
...otherProps
}: SearchAutoCompleteProps) => {
const { inContext, values } = useSearch()
if (inContext && (values.terms.length <= 0 || values.term.length <= 0)) {
return null
}
return (
)
}
export default SearchAutoComplete