import React, { type HTMLAttributes } from 'react'
import { List, useSearch } from '../..'
export interface SearchProductsProps extends HTMLAttributes {
/**
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
*/
testId?: string
/**
* Title attribute for the tag rendered by this component.
*/
title?: string
}
const SearchProductsProps = ({
testId = 'fs-search-products',
title = 'Suggested Products',
children,
...otherProps
}: SearchProductsProps) => {
const { inContext, values } = useSearch()
if (inContext && values.products.length <= 0) {
return null
}
return (
)
}
export default SearchProductsProps