@@ -26,9 +26,9 @@ const description =
2626 class =" hidden p-4 mb-4 text-blue-800 border border-blue-300 rounded-lg bg-blue-50 dark:bg-gray-800 dark:text-blue-400 dark:border-blue-800"
2727 role =" alert"
2828 >
29- <div class =" flex items-center" >
29+ <div class =" flex items-center center " >
3030 <svg
31- class =" flex-shrink-0 w-4 h-4 mr-2"
31+ class =" flex-shrink-0 w-6 h-6 mr-2"
3232 aria-hidden =" true"
3333 xmlns =" http://www.w3.org/2000/svg"
3434 fill =" currentColor"
@@ -39,13 +39,13 @@ const description =
3939 ></path >
4040 </svg >
4141 <span class =" sr-only" >Info</span >
42- <h3 class =" text-lg font-medium" >Información importante</h3 >
42+ <h3 class =" text-lg !my-0 font-medium" >Información importante</h3 >
4343 </div >
4444 <div class =" mt-2 mb-4 text-sm" >
4545 Guarde el siguiente enlace para poder editar o eliminar esta oferta de trabajo en el futuro. Si pierde este
4646 enlace no podrá realizar cambios.
4747 </div >
48- <div class =" flex" >
48+ <div class =" flex items-center " >
4949 <a
5050 id =" edit-link"
5151 href =" #"
@@ -64,6 +64,24 @@ const description =
6464 </svg >
6565 Editar Empleo
6666 </a >
67+ <button
68+ id =" copy-button"
69+ type =" button"
70+ class =" text-blue-800 bg-transparent border border-blue-300 hover:bg-blue-100 focus:ring-4 focus:outline-none focus:ring-blue-200 font-medium rounded-lg text-xs px-3 py-1.5 text-center inline-flex items-center dark:border-blue-800 dark:text-blue-400 dark:hover:bg-blue-700 dark:hover:text-white dark:focus:ring-blue-800"
71+ >
72+ <svg
73+ class =" w-3 h-3 mr-2"
74+ aria-hidden =" true"
75+ xmlns =" http://www.w3.org/2000/svg"
76+ fill =" currentColor"
77+ viewBox =" 0 0 18 20"
78+ >
79+ <path
80+ d =" M16 1h-3.278A1.992 1.992 0 0 0 11 0H7a1.993 1.993 0 0 0-1.722 1H2a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2Zm-3 14H5a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2Zm0-4H5a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2Zm0-5H5a1 1 0 0 1 0-2h2V2h4v2h2a1 1 0 1 1 0 2Z"
81+ ></path >
82+ </svg >
83+ <span id =" copy-button-text" >Copiar</span >
84+ </button >
6785 </div >
6886 </div >
6987 </article >
@@ -77,12 +95,26 @@ const description =
7795
7896 if (id) {
7997 const editLinkContainer = document.getElementById("edit-link-container");
80- const editLink = document.getElementById("edit-link");
98+ const editLink = document.getElementById("edit-link") as HTMLAnchorElement;
99+ const copyButton = document.getElementById("copy-button");
100+ const copyButtonText = document.getElementById("copy-button-text");
81101
82102 if (editLinkContainer && editLink) {
83103 editLinkContainer.classList.remove("hidden");
84- editLink.setAttribute("href", `/editar-empleo?id=${id}`);
85- editLink.innerText = `${window.location.origin}/editar-empleo?id=${id}`;
104+ const url = `${window.location.origin}/editar-empleo?id=${id}`;
105+ editLink.setAttribute("href", url);
106+ editLink.innerText = url;
107+
108+ if (copyButton && copyButtonText) {
109+ copyButton.addEventListener("click", () => {
110+ navigator.clipboard.writeText(url).then(() => {
111+ copyButtonText.innerText = "¡Copiado!";
112+ setTimeout(() => {
113+ copyButtonText.innerText = "Copiar";
114+ }, 2000);
115+ });
116+ });
117+ }
86118 }
87119 }
88120</script >
0 commit comments