Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons. Approved-by: Michael Zetterberg Approved-by: Erik Tiekstra
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
"use client"
|
|
|
|
import { useState } from "react"
|
|
|
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
|
|
|
import JsonToHtml from "@/components/JsonToHtml"
|
|
import Button from "@/components/TempDesignSystem/Button"
|
|
|
|
import SidePeek from "../../SidePeek"
|
|
|
|
import styles from "./sidepeek.module.css"
|
|
|
|
import type { AlertSidepeekProps } from "./sidepeek"
|
|
|
|
export default function AlertSidepeek({
|
|
ctaText,
|
|
sidePeekContent,
|
|
}: AlertSidepeekProps) {
|
|
const [sidePeekIsOpen, setSidePeekIsOpen] = useState(false)
|
|
const { heading, content } = sidePeekContent
|
|
|
|
return (
|
|
<div className={styles.alertSidepeek}>
|
|
<Button
|
|
onPress={() => setSidePeekIsOpen(true)}
|
|
theme="base"
|
|
variant="icon"
|
|
intent="text"
|
|
size="small"
|
|
wrapping
|
|
>
|
|
{ctaText}
|
|
<MaterialIcon icon="chevron_right" size={20} color="CurrentColor" />
|
|
</Button>
|
|
|
|
<SidePeek
|
|
title={heading}
|
|
isOpen={sidePeekIsOpen}
|
|
handleClose={() => setSidePeekIsOpen(false)}
|
|
>
|
|
<JsonToHtml
|
|
nodes={content.json.children}
|
|
embeds={content.embedded_itemsConnection.edges}
|
|
/>
|
|
</SidePeek>
|
|
</div>
|
|
)
|
|
}
|