mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
refactor(gitops): migrate git form to react [EE-4849] (#8268)
This commit is contained in:
parent
afe6cd6df0
commit
273a3f9a10
130 changed files with 3194 additions and 1190 deletions
|
@ -1,4 +1,4 @@
|
|||
import { PropsWithChildren } from 'react';
|
||||
import { ComponentProps, PropsWithChildren } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { Check, Copy } from 'lucide-react';
|
||||
|
||||
|
@ -14,6 +14,7 @@ export interface Props {
|
|||
fadeDelay?: number;
|
||||
displayText?: string;
|
||||
className?: string;
|
||||
color?: ComponentProps<typeof Button>['color'];
|
||||
}
|
||||
|
||||
export function CopyButton({
|
||||
|
@ -21,6 +22,7 @@ export function CopyButton({
|
|||
fadeDelay = 1000,
|
||||
displayText = 'copied',
|
||||
className,
|
||||
color,
|
||||
children,
|
||||
}: PropsWithChildren<Props>) {
|
||||
const { handleCopy, copiedSuccessfully } = useCopy(copyText, fadeDelay);
|
||||
|
@ -29,19 +31,20 @@ export function CopyButton({
|
|||
<div className={styles.container}>
|
||||
<Button
|
||||
className={className}
|
||||
color={color}
|
||||
size="small"
|
||||
onClick={handleCopy}
|
||||
title="Copy Value"
|
||||
type="button"
|
||||
icon={Copy}
|
||||
>
|
||||
<Icon icon={Copy} />
|
||||
{children}
|
||||
</Button>
|
||||
|
||||
<span
|
||||
className={clsx(
|
||||
copiedSuccessfully && styles.fadeout,
|
||||
styles.displayText,
|
||||
styles.copyButton,
|
||||
'space-left',
|
||||
'vertical-center'
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue