Spaces:
Running
Running
| tsx | |
| import * as React from 'react' | |
| import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu' | |
| import { cn } from '@/lib/utils' | |
| export const DropdownMenu = DropdownMenuPrimitive.Root | |
| export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger | |
| export const DropdownMenuContent = React.forwardRef< | |
| React.ElementRef<typeof DropdownMenuPrimitive.Content>, | |
| React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> | |
| >(({ className, sideOffset = 8, ...props }, ref) => ( | |
| <DropdownMenuPrimitive.Portal> | |
| <DropdownMenuPrimitive.Content | |
| ref={ref} | |
| sideOffset={sideOffset} | |
| className={cn( | |
| 'z-50 min-w-[12rem] overflow-hidden rounded-md border border-zinc-200 bg-white p-1 text-zinc-950 shadow-md dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-50', | |
| className | |
| )} | |
| {...props} | |
| /> | |
| </DropdownMenuPrimitive.Portal> | |
| )) | |
| DropdownMenuContent.displayName = 'DropdownMenuContent' | |
| export const DropdownMenuItem = React.forwardRef< | |
| HTMLDivElement, | |
| React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> | |
| >(({ className, ...props }, ref) => ( | |
| <DropdownMenuPrimitive.Item | |
| ref={ref} | |
| className={cn( | |
| 'relative flex cursor-default select-none items-center rounded-sm px-2 py-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800', | |
| className | |
| )} | |
| {...props} | |
| /> | |
| )) | |
| DropdownMenuItem.displayName = 'DropdownMenuItem' | |
| </html> |