We are going to create a method that is going to help us to copy our data when we click on the global
icon.
But for that, we also need another hook from our React module and that is the use Redbook.
So just imported, inventive imported.
If we are going to create another constant and that's name it, copy button, which is going to use
to use folk.
Now we're going to assign this button a reference to our use or misuse raffle.
So to clipboard icon and give it to Jeff.
And that is going to be equal to a copy button.
All right, so we are certain of the difference now in diameter.
Now let's create a method that is going to help us to copy our data from Iowa so that we can save it
inside a clipboard.
So let's create a constant animate copy from.
Clipboard and this is going to be an area function, and this is going to have a body and the first
thing to do is that it will be creating a constant new text area.
Now this is going to be equal to a document.
Document that create element and this is going to be of type text area.
So that's why the I mean the text, you know, after this, what I want to do is that we're going to
assign this text to area property.
I must say I value and that is going to be a password because we want to copy a password, right?
So in your text area, not in a text, which is going to be called a password.
So we are copying our password into new text area, and now we need to appended so document the body.
Append child, and this is going to be passed to a new text area.
All right, so we have appointed a child now we need to selected to a new tax area.
Let's select.
No Dixie Command.
And this is going to be holding a value copy now after this will be removing it.
So new text area.
And three months now until plasticity remote function, it is going to remove our child.
So after this will be creating will be adding copy button.
The current.
They're disabled.
Being equal to false.
Then you will go to and after it is true, will be creating a set time old method to set timeout.
And this is going to have another function and this needs to work when copy.
But under current.
The disabled is going to turn to for.
After three seconds, so passes 3000 milliseconds.
OK, so we have set it up to function and that is going to copy our data from a clipboard.
Now we need to create another method that is going to notify the user that we have successfully copied
our data.
So that's what we're going to do next.