diff --git a/apps/frontend/src/app/settings/-components/CopyButton/index.tsx b/apps/frontend/src/app/settings/-components/CopyButton/index.tsx index e80c480c..d789569e 100644 --- a/apps/frontend/src/app/settings/-components/CopyButton/index.tsx +++ b/apps/frontend/src/app/settings/-components/CopyButton/index.tsx @@ -1,29 +1,35 @@ import './index.css' import { Button, Tooltip } from '@mui/material' +import classNames from 'classnames' +import { noop } from 'radashi' +import { ReactNode } from 'react' import { useCopyToClipboard } from '~/hooks' type CopyButtonProps = { + className?: string, copyText: string, - onClick?: () => Record, - children: React.ReactNode, - style?: Record, + onClick?: () => void, + children: ReactNode, } -const CopyButton = ( - { copyText, onClick: originalOnClick = () => ( {} ), ...props }: CopyButtonProps -) => { +const CopyButton = ( { + className, + copyText, + onClick = noop, + ...props +}: CopyButtonProps ) => { const copyToClipboard = useCopyToClipboard() - const onClick = () => { - originalOnClick() + const handleClick = () => { + onClick() copyToClipboard( copyText ) } return ( -