"use client" import { IconCheck, IconChevronDown, IconCopy } from "@tabler/icons-react" import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard" import { Button } from "@/registry/new-york-v4/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/registry/new-york-v4/ui/dropdown-menu" import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, } from "@/registry/new-york-v4/ui/popover" import { Separator } from "@/registry/new-york-v4/ui/separator" function getPromptUrl(baseURL: string, url: string) { return `${baseURL}?q=${encodeURIComponent( `I’m looking at this shadcn/ui documentation: ${url}. Help me understand how to use it. Be ready to explain concepts, give examples, or help debug based on it. ` )}` } const menuItems = { markdown: (url: string) => ( View as Markdown ), v0: (url: string) => ( Open in v0 ), chatgpt: (url: string) => ( Open in ChatGPT ), claude: (url: string) => ( Open in Claude ), scira: (url: string) => ( Open in Scira ), } export function DocsCopyPage({ page, url }: { page: string; url: string }) { const { copyToClipboard, isCopied } = useCopyToClipboard() const trigger = ( ) return (
{trigger} {Object.entries(menuItems).map(([key, value]) => ( {value(url)} ))} {trigger} {Object.entries(menuItems).map(([key, value]) => ( ))}
) }