ChrQR
7b97a0eb65
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.
16 lines
469 B
TypeScript
16 lines
469 B
TypeScript
import { TempInfo } from "@/types/types";
|
|
|
|
export default function Temperature(props: {tempInfo:TempInfo}) {
|
|
const kelvin = 273.15;
|
|
const tempInfo = props.tempInfo;
|
|
const fullTemp = tempInfo.temp - kelvin;
|
|
const temperature = fullTemp.toFixed(2);
|
|
const fullFeels = tempInfo.feels_like - kelvin;
|
|
const feelsLike = fullFeels.toFixed(2);
|
|
|
|
return (
|
|
<p>The temperature right now is {temperature}°C and feels like {feelsLike}°C</p>
|
|
)
|
|
}
|
|
|