import { CheckCircleIcon } from "@heroicons/react/outline"; import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import Link from "next/link"; import { ComponentProps, forwardRef } from "react"; import { Icon } from "react-feather"; import { classNames } from "@calcom/lib"; export const Dropdown = DropdownMenuPrimitive.Root; type DropdownMenuTriggerProps = ComponentProps; export const DropdownMenuTrigger = forwardRef( ({ className = "", ...props }, forwardedRef) => ( ) ); DropdownMenuTrigger.displayName = "DropdownMenuTrigger"; export const DropdownMenuTriggerItem = DropdownMenuPrimitive.TriggerItem; type DropdownMenuContentProps = ComponentProps; export const DropdownMenuContent = forwardRef( ({ children, align = "end", ...props }, forwardedRef) => { return ( {children} ); } ); DropdownMenuContent.displayName = "DropdownMenuContent"; type DropdownMenuLabelProps = ComponentProps; export const DropdownMenuLabel = (props: DropdownMenuLabelProps) => ( ); type DropdownMenuItemProps = ComponentProps; export const DropdownMenuItem = forwardRef( ({ className = "", ...props }, forwardedRef) => ( ) ); DropdownMenuItem.displayName = "DropdownMenuItem"; export const DropdownMenuGroup = DropdownMenuPrimitive.Group; type DropdownMenuCheckboxItemProps = ComponentProps; export const DropdownMenuCheckboxItem = forwardRef( ({ children, ...props }, forwardedRef) => { return ( {children} ); } ); DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem"; export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup; type DropdownMenuRadioItemProps = ComponentProps; export const DropdownMenuRadioItem = forwardRef( ({ children, ...props }, forwardedRef) => { return ( {children} ); } ); DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem"; type DropdownItemProps = { children: React.ReactNode; color?: "destructive"; StartIcon?: Icon; EndIcon?: Icon; href?: string; disabled?: boolean; } & ButtonOrLinkProps; type ButtonOrLinkProps = ComponentProps<"button"> & ComponentProps<"a">; export function ButtonOrLink({ href, ...props }: ButtonOrLinkProps) { const isLink = typeof href !== "undefined"; const ButtonOrLink = isLink ? "a" : "button"; const content = ; if (isLink) { return {content}; } return content; } export const DropdownItem = (props: DropdownItemProps) => { const { StartIcon, EndIcon } = props; return ( <> {StartIcon && }
{props.children}
{EndIcon && }
); }; export const DropdownMenuSeparator = DropdownMenuPrimitive.Separator; export default Dropdown;