import classnames from 'classnames'; import type { ReactNode } from 'react'; import { motion } from 'framer-motion'; import { Portal } from './Portal'; interface Props { children: ReactNode; onClick?: () => void; portalName: string; open: boolean; zIndex?: keyof typeof zIndexes; } const zIndexes: Record = { 10: 'z-10', 20: 'z-20', 30: 'z-30', 40: 'z-40', 50: 'z-50', }; export function Overlay({ zIndex = 30, open, children, onClick, portalName }: Props) { return ( {open && (
{children} )} ); }