More typing and fixes

This commit is contained in:
Sean Edmunds
2025-04-25 15:02:00 -05:00
parent 74893ac68d
commit b280909ec9
31 changed files with 230 additions and 110 deletions

View File

@@ -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,