"use client" import { Children, cloneElement, PropsWithChildren } from "react" import { Dialog, DialogTrigger, Modal } from "react-aria-components" import styles from "./sidePeek.module.css" type SidePeekProps = { activeContent: string | null onClose: (isOpen: boolean) => void } export default function SidePeek({ children, onClose, activeContent, }: PropsWithChildren) { return ( {({ close }) => ( <> {Children.map(children, (child) => { return cloneElement(child as React.ReactElement, { onClose: close, }) })} )} ) }