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;
