"use client"; import * as PopoverPrimitive from "@radix-ui/react-popover"; import { AnimatePresence, motion } from "framer-motion"; import { ReactNode, useState } from "react"; import Button from "./Button"; interface PopoverProps { children?: ReactNode; Trigger: ReactNode; ActionTrigger?: ReactNode; CloseTrigger?: ReactNode; } const Popover = ({ children, Trigger, ActionTrigger, CloseTrigger, }: PopoverProps): JSX.Element => { const [open, setOpen] = useState(false); return ( {Trigger} {open && (
{children}
{ActionTrigger !== undefined && ( {ActionTrigger} )} {CloseTrigger === undefined ? ( ) : ( CloseTrigger )}
)}
); }; export default Popover;