Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 4x 8x 6x | import { type Nick } from '../../domain/model/Nick';
import { Button, CopyButton, Group, Text } from '@mantine/core';
import { IconCheck, IconCopy } from '@tabler/icons-react';
interface Props {
nick: Nick;
onClick?: () => void
}
export function CopyNickButton({ nick, onClick }: Props) {
return (
<CopyButton value={nick.words.map(w => w.label).join(' ')} timeout={2000}>
{({ copied, copy }) => (
<Button fullWidth variant="subtle" onClick={() => {copy(); if(onClick) onClick();}}>
<Group gap="xs">
{copied ? <IconCheck size={16} /> : <IconCopy size={16} />}
{ copied ? <Text>CopiƩ</Text> : <Text>Copier</Text> }
</Group>
</Button>
)}
</CopyButton>
);
}
|