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

View File

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