make opening hours a nice box too

This commit is contained in:
elise
2024-08-06 14:41:19 +02:00
parent b1d767ae17
commit 929d5c070f
3 changed files with 43 additions and 40 deletions

View File

@ -46,23 +46,25 @@ export async function OpeningHoursSectionBlock() {
return (
<section className={styles.openingHoursSection}>
{announcement && <p>{announcement}</p>}
{subsections.map((subsection) => {
const [slug, title] = subsection;
const prettyHours = getPrettyOpeningHoursForFunction(
allOpeningHours,
slug
);
if (!prettyHours || prettyHours?.length === 0) {
return <></>;
}
return (
<OpeningHoursSubsection
key={slug}
title={title}
prettyHours={prettyHours}
/>
);
})}
<div className={styles.openingHoursList}>
{subsections.map((subsection) => {
const [slug, title] = subsection;
const prettyHours = getPrettyOpeningHoursForFunction(
allOpeningHours,
slug
);
if (!prettyHours || prettyHours?.length === 0) {
return <></>;
}
return (
<OpeningHoursSubsection
key={slug}
title={title}
prettyHours={prettyHours}
/>
);
})}
</div>
</section>
);
}