import { useContext } from "react";
import AppContext from "../context/app";
const Calendar = () => {
const { loading, songs, openDoor } = useContext(AppContext);
if (loading || !songs) {
return null;
}
return (
{songs.map((song, index) => {
const classes = ["calcard", song.locked && "calcard__locked"]
.filter(Boolean)
.join(" ");
return (
- !song.locked && openDoor(index)}
title={
song.locked &&
`Es ist noch nicht der ${new Date(
song.lockedUntil
).toLocaleDateString()}! Geduld, nur Geduld!` || index + 1
}
>
{index + 1}
);
})}
);
};
export default Calendar;