local-weather/app/page.tsx

28 lines
770 B
TypeScript
Raw Normal View History

2024-05-05 20:55:51 +00:00
'use client'
2024-05-04 21:04:30 +00:00
import LocationSearch from '@/components/LocationSearch';
import WeatherNow from '../components/WeatherNow'
2024-05-05 20:55:51 +00:00
import { useState } from 'react';
import { defaultState } from './defaultState';
import { coordType } from '@/types/types';
2024-05-07 19:18:51 +00:00
import WeatherIcon from '@/components/WeatherIcon';
const defaultGeoLocation: coordType = {
lat: 55.647229603577124,
lng: 12.54995987788925
}
2024-05-04 07:39:10 +00:00
export default function Home() {
const [geoLocation, setGeoLocation] = useState({
lat: 55.647229603577124,
lng: 12.54995987788925
});
2024-05-04 07:39:10 +00:00
return (
<main>
2024-05-04 21:04:30 +00:00
<div className='block mx-auto max-w-4xl'>
<LocationSearch setGeoLocation={setGeoLocation}/>
2024-05-07 19:18:51 +00:00
<WeatherIcon />
<WeatherNow geoLocation={geoLocation}/>
2024-05-04 21:04:30 +00:00
</div>
2024-05-03 14:48:24 +00:00
</main>
);
2024-05-04 13:40:23 +00:00
}