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