minor ui improvements for profile

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-05-13 16:08:40 +02:00
parent b91e0d0aa9
commit c4b02108ac
7 changed files with 96 additions and 72 deletions

View File

@@ -0,0 +1,30 @@
'use client';
import { clipboard } from '@/utils/clipboard';
import { toast } from 'sonner';
import { Tooltiper } from './ui/tooltip';
type Props = {
children: React.ReactNode;
className?: string;
value: string;
};
const ClickToCopy = ({ children, value }: Props) => {
return (
<Tooltiper
content="Click to copy"
asChild
className="cursor-pointer"
onClick={() => {
clipboard(value);
toast('Copied to clipboard');
}}
>
{children}
</Tooltiper>
);
};
export default ClickToCopy;