fix home location info state

This commit is contained in:
NCanggoro 2023-10-03 14:52:42 +07:00
parent f1b508685e
commit 408ff41b7d

View File

@ -7,18 +7,7 @@ import './style.css';
import { useEffect, useState } from 'preact/hooks';
import { getListRecentLocationsRatingsService } from '../../services';
import { useNavigate } from 'react-router-dom';
type NewPlaces = {
id: Number,
name: string,
thumbnail: NullValueRes<'String', string>,
regency_name: String,
province_name: String,
critic_score: Number,
critic_count: Number,
user_score: Number,
user_count: Number
}
import { LocationInfo } from '../../domains/LocationInfo';
type News = {
header: string,
@ -29,7 +18,7 @@ type News = {
}
function Home() {
const [recentLocations, setRecentLocations] = useState<Array<NewPlaces>>([])
const [recentLocations, setRecentLocations] = useState<Array<LocationInfo>>([])
// const [isLoading, setIsLoading] = useState<boolean>(true)
const navigate = useNavigate()