local-weather/app/page.tsx
ChrQR 7b97a0eb65 Fixed some things.
Need to fix google places call. It is refreshing the page when receiving the data, thus resetting the state.

It's a job for tomorrow.
2024-05-06 23:22:57 +02:00

28 lines
794 B
TypeScript

'use client'
import LocationSearch from '@/components/LocationSearch';
import WeatherNow from '../components/WeatherNow'
import { useState } from 'react';
import { defaultState } from './defaultState';
import { coordType } from '@/types/types';
const defaultGeoLocation: coordType = {
lat: 55.647229603577124,
lng: 12.54995987788925
}
export default function Home() {
const [geoLocation, setGeoLocation] = useState({
lat: 55.647229603577124,
lng: 12.54995987788925
});
return (
<main>
<div className='block mx-auto max-w-4xl'>
<LocationSearch setGeoLocation={setGeoLocation}/>
<h1>The weather in {} for the next 3 days</h1>
<WeatherNow geoLocation={geoLocation}/>
<p>{JSON.stringify(geoLocation)}</p>
</div>
</main>
);
}