diff --git a/ui/components/src/CopyContainer/CopyContainer.tsx b/ui/components/src/CopyContainer/CopyContainer.tsx index 7272d0d72..bc7378ba4 100644 --- a/ui/components/src/CopyContainer/CopyContainer.tsx +++ b/ui/components/src/CopyContainer/CopyContainer.tsx @@ -12,6 +12,14 @@ export interface CopyContainerProps { * value to copy */ value: string; + /** + * maximum length of string to be displayed in copied tooltip + */ + maxLength?: number; + /** + * copy-to-clipboard options + */ + options?: Parameters[1]; } /** @@ -21,6 +29,7 @@ export interface CopyContainerProps { export const CopyContainer: FC = ({ name, value, + maxLength = 50, children, ...rest }) => { @@ -58,7 +67,11 @@ export const CopyContainer: FC = ({ {`${ name && name !== value ? `${name} ` : '' - }copied ${value}`} + }copied ${ + value.length > maxLength + ? `${value.substring(0, maxLength)}...` + : value + }`} )} >