summaryrefslogtreecommitdiff
path: root/web_page/webpage-shorlink/src/components/ShowUrl.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web_page/webpage-shorlink/src/components/ShowUrl.jsx')
-rw-r--r--web_page/webpage-shorlink/src/components/ShowUrl.jsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/web_page/webpage-shorlink/src/components/ShowUrl.jsx b/web_page/webpage-shorlink/src/components/ShowUrl.jsx
new file mode 100644
index 0000000..d063c5e
--- /dev/null
+++ b/web_page/webpage-shorlink/src/components/ShowUrl.jsx
@@ -0,0 +1,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;