local-weather/components/DailyCard/CardContainer.tsx
ChrQR 83b337db03
All checks were successful
Docker Build & Publish / Build Docker (push) Successful in 1m9s
Fixed for mobile?
2024-05-12 21:14:36 +02:00

20 lines
661 B
TypeScript

import { Forecast } from "@/types/types";
import DailyCard from "./DailyCard";
export default function CardContainer(props: {weather: Forecast}) {
const weather = props.weather;
return (
<div className="flex overflow-scroll justify-center">
{weather.daily && weather.daily.apparent_temperature_max.map((temp, index) => (
index > 0 &&
index < 7 && // Ensure we only render the next 6 days
<DailyCard
key={index}
temperature={temp}
weatherCode={weather.daily.weather_code[index]}
time={weather.daily.time[index]}
/>
))}
</div>
)
};