local-weather/components/DailyCard/CardContainer.tsx
ChrQR a1b7c12821
All checks were successful
Docker Build & Publish / Build Docker (push) Successful in 1m8s
fixed scroll bars on chrome
2024-05-13 09:30:43 +02:00

24 lines
744 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="p-2 flex overflow-x-scroll md:overflow-hidden md:justify-center w-full">
{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>
);
}