1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import { useState } from "react"; import AddUrl from "./AddUrl"; import "./ShowUrl.css"; function ShowUrl() { const [short, setShort] = useState(); return ( <div> <AddUrl setShort={setShort} /> <p onClick={() => { navigator.clipboard.writeText(short); alert("Link copiado"); }} > {short} </p> </div> ); } export default ShowUrl;