import React, { Fragment } from 'react' import { LinkIcon } from '@heroicons/react/outline' import { Menu, Transition } from '@headlessui/react' import clsx from 'clsx' import { copyToClipboard } from 'web/lib/util/copy' import { ToastClipboard } from 'web/components/toast-clipboard' import { track } from 'web/lib/service/analytics' import { Row } from './layout/row' export function CopyLinkButton(props: { url: string displayUrl?: string tracking?: string buttonClassName?: string toastClassName?: string }) { const { url, displayUrl, tracking, buttonClassName, toastClassName } = props return ( { copyToClipboard(url) track(tracking ?? 'copy share link') }} > ) }