feat: prettier
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import {Button, rem, Tooltip} from '@mantine/core';
|
||||
import {IconCheck, IconCopy} from '@tabler/icons-react';
|
||||
import {FC} from "react";
|
||||
import {useClipboard} from "@mantine/hooks";
|
||||
import { Button, rem, Tooltip } from "@mantine/core";
|
||||
import { IconCheck, IconCopy } from "@tabler/icons-react";
|
||||
import { FC } from "react";
|
||||
import { useClipboard } from "@mantine/hooks";
|
||||
|
||||
type Props = {
|
||||
children: string;
|
||||
value: string
|
||||
value: string;
|
||||
onCopiedLabel: string;
|
||||
}
|
||||
};
|
||||
|
||||
export const ButtonCopy: FC<Props> = ({children, onCopiedLabel, value}) => {
|
||||
export const ButtonCopy: FC<Props> = ({ children, onCopiedLabel, value }) => {
|
||||
const clipboard = useClipboard();
|
||||
|
||||
return (
|
||||
@@ -18,20 +18,19 @@ export const ButtonCopy: FC<Props> = ({children, onCopiedLabel, value}) => {
|
||||
offset={5}
|
||||
position="bottom"
|
||||
radius="xl"
|
||||
transitionProps={{duration: 100, transition: 'slide-down'}}
|
||||
opened={clipboard.copied}
|
||||
>
|
||||
transitionProps={{ duration: 100, transition: "slide-down" }}
|
||||
opened={clipboard.copied}>
|
||||
<Button
|
||||
variant="light"
|
||||
rightSection={
|
||||
clipboard.copied ? (
|
||||
<IconCheck
|
||||
style={{width: rem(20), height: rem(20)}}
|
||||
style={{ width: rem(20), height: rem(20) }}
|
||||
stroke={1.5}
|
||||
/>
|
||||
) : (
|
||||
<IconCopy
|
||||
style={{width: rem(20), height: rem(20)}}
|
||||
style={{ width: rem(20), height: rem(20) }}
|
||||
stroke={1.5}
|
||||
/>
|
||||
)
|
||||
@@ -42,13 +41,12 @@ export const ButtonCopy: FC<Props> = ({children, onCopiedLabel, value}) => {
|
||||
root: {
|
||||
paddingRight: rem(14),
|
||||
},
|
||||
section: {marginLeft: rem(22)},
|
||||
section: { marginLeft: rem(22) },
|
||||
}}
|
||||
onClick={() => clipboard.copy(value)}
|
||||
>
|
||||
onClick={() => clipboard.copy(value)}>
|
||||
{children}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
export default ButtonCopy;
|
||||
};
|
||||
export default ButtonCopy;
|
||||
|
||||
Reference in New Issue
Block a user