import {ChangeEvent} from "react"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {IconDefinition} from "@fortawesome/fontawesome-svg-core"; import {SelectBoxProps} from "@/shared/interface"; interface SearchInputWithSelectProps { selectValue: string; setSelectValue: (value: string) => void; selectOptions: SelectBoxProps[]; inputValue: string; setInputValue: (value: string) => void; inputPlaceholder?: string; searchIcon: IconDefinition; onSearch: () => void; onKeyDown?: (e: React.KeyboardEvent) => void; } export default function SearchInputWithSelect( { selectValue, setSelectValue, selectOptions, inputValue, setInputValue, inputPlaceholder, searchIcon, onSearch, onKeyDown }: SearchInputWithSelectProps) { return (
) => setInputValue(e.target.value)} placeholder={inputPlaceholder} className="w-full bg-secondary/50 text-text-primary px-4 py-2.5 rounded-xl border border-secondary/50 focus:border-primary focus:ring-4 focus:ring-primary/20 focus:bg-secondary hover:bg-secondary hover:border-secondary placeholder:text-muted/60 outline-none transition-all duration-200 pr-12" onKeyDown={onKeyDown} />
); }