2024-05-06 21:22:57 +00:00
|
|
|
import { TempInfo } from "@/types/types";
|
2024-05-05 07:51:29 +00:00
|
|
|
|
2024-05-06 21:22:57 +00:00
|
|
|
export default function Temperature(props: {tempInfo:TempInfo}) {
|
2024-05-05 07:51:29 +00:00
|
|
|
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>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|