"use client" import { useContext, useRef } from "react" import { Dialog, Modal, ModalOverlay } from "react-aria-components" import { useIntl } from "react-intl" import { MaterialIcon } from "@scandic-hotels/design-system/Icons" import { Typography } from "@scandic-hotels/design-system/Typography" import { SidePeekContext } from "@/components/SidePeeks/SidePeekProvider" import Button from "../Button" import SidePeekSEO from "./SidePeekSEO" import styles from "./sidePeek.module.css" import type { SidePeekProps } from "./sidePeek" export default function SidePeek({ children, title, contentKey, handleClose, isOpen, openInRoot = false, }: React.PropsWithChildren) { const intl = useIntl() const rootDiv = useRef(null) const context = useContext(SidePeekContext) function onClose() { const closeHandler = handleClose || context?.handleClose closeHandler && closeHandler(false) } return ( <>
{children} ) }