summaryrefslogtreecommitdiff
path: root/web_page/webpage-shorlink/src/components/ShowUrl.jsx
blob: d063c5e656d3a6dad257ab6288df4ea0bb1bba83 (plain)
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;