diff --git a/web/containers/ModelSearch/index.tsx b/web/containers/ModelSearch/index.tsx index aa40f8331..9be47a9ec 100644 --- a/web/containers/ModelSearch/index.tsx +++ b/web/containers/ModelSearch/index.tsx @@ -5,22 +5,12 @@ import { SearchIcon } from 'lucide-react' import { useDebouncedCallback } from 'use-debounce' -import { - useGetModelSources, - useModelSourcesMutation, -} from '@/hooks/useModelSource' - -import Spinner from '../Loader/Spinner' - type Props = { onSearchLocal?: (searchText: string) => void } const ModelSearch = ({ onSearchLocal }: Props) => { const [searchText, setSearchText] = useState('') - const [isSearching, setSearching] = useState(false) - const { mutate } = useGetModelSources() - const { addModelSource } = useModelSourcesMutation() const inputRef = useRef(null) const debounced = useDebouncedCallback(async () => { if (searchText.indexOf('/') === -1) { @@ -30,16 +20,6 @@ const ModelSearch = ({ onSearchLocal }: Props) => { } // Attempt to search local onSearchLocal?.(searchText) - - setSearching(true) - // Attempt to search model source - addModelSource(searchText) - .then(() => mutate()) - .then(() => onSearchLocal?.(searchText)) - .catch((e) => { - console.debug(e) - }) - .finally(() => setSearching(false)) }, 300) const onSearchChanged = useCallback( @@ -70,20 +50,14 @@ const ModelSearch = ({ onSearchLocal }: Props) => { return ( - ) : ( - - ) - } - placeholder="Search or enter Hugging Face URL" + prefixIcon={} + placeholder="Search models..." onChange={onSearchChanged} onKeyDown={onKeyDown} value={searchText} clearable={searchText.length > 0} onClear={onClear} - className="border-0 bg-[hsla(var(--app-bg))]" + className="border-1 bg-[hsla(var(--app-bg))]" onClick={() => { onSearchLocal?.(inputRef.current?.value ?? '') }}