More typing and fixes
This commit is contained in:
@@ -5,7 +5,7 @@ import { useEffect, useState } from 'react';
|
||||
import { FaLongArrowAltDown, FaLongArrowAltUp, FaWind } from 'react-icons/fa';
|
||||
import { WiBarometer, WiHumidity, WiSunrise, WiSunset } from 'react-icons/wi';
|
||||
import { themeIconClasses } from 'styles';
|
||||
import type { CurrentWeather as CW } from 'types';
|
||||
import type { CurrentWeather as CW, SunState } from 'types';
|
||||
import WeatherIcon from './WeatherIcon';
|
||||
|
||||
export default function CurrentWeather({ current }: { current: CW }) {
|
||||
@@ -15,12 +15,12 @@ export default function CurrentWeather({ current }: { current: CW }) {
|
||||
lon: currentLocation.lon,
|
||||
});
|
||||
|
||||
const [sunStates, setSunStates] = useState<any>([]);
|
||||
const [sunStates, setSunStates] = useState<SunState[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (sunStateData) {
|
||||
setSunStates(
|
||||
sunStateData.results.map((item: any) => {
|
||||
sunStateData.results.map((item: SunState) => {
|
||||
return {
|
||||
date: item.date,
|
||||
sunrise: item.sunrise,
|
||||
|
||||
Reference in New Issue
Block a user