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