import { LoaderCircle } from 'lucide-react'
import type { CSSProperties } from 'react'
import Block from '../Primitives/Block/Block'
import Text from '../Text/Text'
import { FOUNDATION_THEME } from '../../tokens'
type SelectSearchStatusProps = {
isControlled: boolean
isLoading: boolean
isEmpty: boolean
emptyStateText: string
}
export const SELECT_SEARCH_STATUS_HEIGHT = 36
const visuallyHiddenStyle: CSSProperties = {
position: 'absolute',
width: 1,
height: 1,
padding: 0,
margin: -1,
overflow: 'hidden',
clip: 'rect(0, 0, 0, 0)',
clipPath: 'inset(50%)',
whiteSpace: 'nowrap',
borderWidth: 0,
}
const SelectSearchStatus = ({
isControlled,
isLoading,
isEmpty,
emptyStateText,
}: SelectSearchStatusProps) => {
if (!isControlled && !isLoading) return null
const announcement = isLoading
? 'Searching'
: isEmpty
? emptyStateText
: 'Search results updated'
return (
<>
{isLoading && (
Searching…
)}
{announcement}
>
)
}
export default SelectSearchStatus