feat(SW-1012): add caption

This commit is contained in:
Fredrik Thorsson
2024-12-11 16:25:31 +01:00
parent baf4055938
commit 9e05165973
2 changed files with 14 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
import Body from "@/components/TempDesignSystem/Text/Body"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import { getIntl } from "@/i18n"
import styles from "./openingHours.module.css"
import {
Days,
type RestaurantBarOpeningHoursProps,
@@ -9,6 +12,7 @@ import type { RestaurantOpeningHoursDay } from "@/types/hotel"
export default async function OpeningHours({
openingHours,
alternateOpeningHours,
}: RestaurantBarOpeningHoursProps) {
const intl = await getIntl()
@@ -52,7 +56,7 @@ export default async function OpeningHours({
}
return (
<div>
<div className={styles.wrapper}>
<Body textTransform="bold">{openingHours.name}</Body>
{Object.entries(groupedOpeningHours).map(([time, days]) => {
return (
@@ -61,6 +65,11 @@ export default async function OpeningHours({
</Body>
)
})}
{alternateOpeningHours?.name ? (
<Caption color="uiTextMediumContrast">
{alternateOpeningHours.name}
</Caption>
) : null}
</div>
)
}

View File

@@ -0,0 +1,4 @@
.wrapper {
display: grid;
gap: var(--Spacing-x-half);
}