import { twMerge } from "tailwind-merge"; import ScrollableHandler from "../ScrollableHandler"; import type { HTMLAttributes, PreactDOMAttributes } from "preact"; import type { ScrollableHandlerProps } from "../ScrollableHandler"; export type OverlayProps = { className; ScrollableHandlerProps?: ScrollableHandlerProps; } & HTMLAttributes & PreactDOMAttributes; function Overlay({ children, className, ScrollableHandlerProps = {}, }: OverlayProps) { let hasChildren = !!children; if (Array.isArray(children)) { hasChildren = children?.length && (children || []).find((c) => { return !!c; }); } if (!hasChildren) { return null; } return (
{children}
); } export default Overlay;