mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 14:31:22 -05:00
Fix ESLint errors
This commit is contained in:
@@ -29,7 +29,7 @@ export function HeadquartersLocationInput({
|
||||
onChange,
|
||||
disabled = false,
|
||||
className
|
||||
}: HeadquartersLocationInputProps) {
|
||||
}: HeadquartersLocationInputProps): React.JSX.Element {
|
||||
const [mode, setMode] = useState<'search' | 'manual'>('search');
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [results, setResults] = useState<LocationResult[]>([]);
|
||||
@@ -44,7 +44,7 @@ export function HeadquartersLocationInput({
|
||||
return;
|
||||
}
|
||||
|
||||
const timeoutId = setTimeout(async () => {
|
||||
const timeoutId = setTimeout(async (): Promise<void> => {
|
||||
setIsSearching(true);
|
||||
try {
|
||||
const response = await fetch(
|
||||
@@ -59,7 +59,7 @@ export function HeadquartersLocationInput({
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
const data = await response.json() as LocationResult[];
|
||||
setResults(data);
|
||||
setShowResults(true);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ export function HeadquartersLocationInput({
|
||||
return result.display_name;
|
||||
};
|
||||
|
||||
const handleSelectLocation = (result: LocationResult) => {
|
||||
const handleSelectLocation = (result: LocationResult): void => {
|
||||
const formatted = formatLocation(result);
|
||||
onChange(formatted);
|
||||
setSearchQuery('');
|
||||
@@ -95,7 +95,7 @@ export function HeadquartersLocationInput({
|
||||
setResults([]);
|
||||
};
|
||||
|
||||
const handleClear = () => {
|
||||
const handleClear = (): void => {
|
||||
onChange('');
|
||||
setSearchQuery('');
|
||||
setResults([]);
|
||||
|
||||
Reference in New Issue
Block a user