File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 11import { useState } from "react" ;
22import { Link , useNavigate } from "react-router-dom" ;
3- import styles from '../styles/SearchSection.module.css' ;
43import { useConfig } from "../hooks/useConfig" ;
4+ import styles from '../styles/SearchSection.module.css' ;
55
66const SearchSection = ( ) => {
77 const [ query , setQuery ] = useState ( "" ) ;
88 const [ error , setError ] = useState ( false ) ; // State to track error visibility
99 const navigate = useNavigate ( ) ;
10+ const { apiBaseUrl } = useConfig ( ) ;
1011
1112 const handleSearch = async ( e : React . FormEvent ) => {
1213 e . preventDefault ( ) ;
1314 if ( ! query . trim ( ) ) return ;
1415
1516 try {
16- const { apiBaseUrl } = useConfig ( ) ;
1717 const response = await fetch (
1818 `${ apiBaseUrl } /api/search?query=${ query . trim ( ) } &ps=1` ) ;
1919 const result = await response . json ( ) ;
You can’t perform that action at this time.
0 commit comments