import { Box, Button, Scrollable } from '@rocket.chat/fuselage';
import type { ComponentProps, ReactElement } from 'react';
import { useTranslation } from 'react-i18next';
import useClipboardWithToast from '../hooks/useClipboardWithToast';
const defaultWrapperRenderer = (text: string): ReactElement => (
{text}
);
type TextCopyProps = {
text: string;
wrapper?: (text: string) => ReactElement;
} & ComponentProps;
const TextCopy = ({ text, wrapper = defaultWrapperRenderer, ...props }: TextCopyProps): ReactElement => {
const { t } = useTranslation();
const { copy } = useClipboardWithToast(text);
const handleClick = () => {
copy();
};
return (
{wrapper(text)}
);
};
export default TextCopy;