mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-27 20:01:10 +01:00
Ability to sync environments to folder (#207)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useCopy } from '../hooks/useCopy';
|
||||
import { useTimedBoolean } from '../hooks/useTimedBoolean';
|
||||
import { copyToClipboard } from '../lib/copy';
|
||||
import { showToast } from '../lib/toast';
|
||||
import type { ButtonProps } from './core/Button';
|
||||
import { Button } from './core/Button';
|
||||
@@ -9,7 +9,6 @@ interface Props extends Omit<ButtonProps, 'onClick'> {
|
||||
}
|
||||
|
||||
export function CopyButton({ text, ...props }: Props) {
|
||||
const copy = useCopy({ disableToast: true });
|
||||
const [copied, setCopied] = useTimedBoolean();
|
||||
return (
|
||||
<Button
|
||||
@@ -23,8 +22,8 @@ export function CopyButton({ text, ...props }: Props) {
|
||||
message: 'Failed to copy',
|
||||
});
|
||||
} else {
|
||||
copy(content);
|
||||
setCopied();
|
||||
copyToClipboard(content, { disableToast: true });
|
||||
setCopied();
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user