Skip to content

Commit

Permalink
Fix wrong component name and copy function
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-nu committed Dec 6, 2024
1 parent cd0e404 commit d361c0e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ type CopyProps = {
content: string;
};

const CopyToClipboard = ({ content }: CopyProps): ReactElement => {
const SaveFile = ({ content }: CopyProps): ReactElement => {
const [isCopied, setCopied] = useState(false);

const onClick = (): void => {
const copyToClipboard = (): void => {
setCopied(true);
navigator.clipboard.writeText(content);

Expand All @@ -34,11 +34,11 @@ const CopyToClipboard = ({ content }: CopyProps): ReactElement => {
<button
type="button"
className={`${styles.copy} ${isCopied && styles.copied}`}
onClick={onClick}
onClick={copyToClipboard}
title="Copy Taskfile content"
/>
</div>
);
};

export default CopyToClipboard;
export default SaveFile;

0 comments on commit d361c0e

Please sign in to comment.