How to make a bottom for customers to copy link to the page?

Hi there!
Does anyone know by any chance how to make customers able to copy a link to the page they are in?

import wixWindow from ‘wix-window’ ;
import wixLocation from ‘wix-location’ ;
$w . onReady ( function () {

  $w ( "#button" ). onClick (( event ) => { 

      wixWindow . copyToClipboard ( wixLocation . url ) 
          . then (() => { 
              // handle case where text was copied 
          }) 
          . catch (( err ) => { 
              // handle case where an error occurred 
          }); 
  }); 

});

https://www.wix.com/velo/reference/wix-window/copytoclipboard
https://www.wix.com/velo/reference/wix-location/url

Can you add something to that code to upon click show a text field that shows something like “Success”?

Also, where do I insert the actual text that needs to be copied?