import { ComponentProps, RefObject } from "react"; import { usePopoverContext } from "."; import { FloatingFocusManager, FloatingPortal, useMergeRefs } from "@floating-ui/react"; import clsx from "clsx"; import { computeArrowStyle } from "../dialog/util"; import { Dialog } from "../dialog"; interface Props extends ComponentProps<"div"> { ref?: RefObject; } export function PopoverContent({ style, children, className, ref, ...props }: Props) { const context = usePopoverContext(); const floatingContext = context.context; const mergedRef = useMergeRefs([context.refs.setFloating, ref]); if (!context.open) { return null; } return (
{children}
); }