deduplicate days

This commit is contained in:
2024-09-02 10:24:42 -06:00
parent 13be104499
commit 1b03061fdd
7 changed files with 60 additions and 18 deletions

View File

@@ -10,20 +10,21 @@ export default function Day({ day, month }: { day: Date; month: number }) {
const backgroundClass = isInSameMonth ? "" : "bg-slate-900";
return (
<>
<div
className={
"border border-slate-600 rounded-lg p-2 pb-4 m-1 " + backgroundClass
}
>
{day.getDate()}
{moduleNames.map((moduleName) => (
<div
key={"" + day + month + moduleName}
className={
"border border-slate-600 rounded-lg p-2 pb-4 m-1 " + backgroundClass
}
onDrop={() => itemDrop(day)}
onDragOver={(e) => e.preventDefault()}
>
{day.getDate()}
<DayItemsInModule day={day} moduleName={moduleName} />
</div>
))}
</>
</div>
);
}