Something went wrong. Try again.
Something went wrong. Try again.
semble src webapp features collections components CollectionShareHeaderButton CollectionShareHeaderButton.tsx
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647'use client';
import { ActionIcon, CopyButton, Tooltip } from '@mantine/core';import { notifications } from '@mantine/notifications';import { MdIosShare } from 'react-icons/md';
interface Props { handle: string; rkey: string;}
export default function CollectionShareHeaderButton(props: Props) { const shareLink = `${process.env.NEXT_PUBLIC_APP_URL}/profile/${props.handle}/collections/${props.rkey}`;
return ( <CopyButton value={shareLink}> {({ copied, copy }) => ( <Tooltip label={copied ? 'Link copied!' : 'Share'} withArrow position="top" > <ActionIcon variant="light" color="gray" size={36} radius={'xl'} onClick={(e) => { e.stopPropagation(); copy();
if (copied) return; notifications.show({ message: 'Link copied!', position: 'top-center', id: `${props.handle}/${props.rkey}`, }); }} > <MdIosShare /> </ActionIcon> </Tooltip> )} </CopyButton> );}