Add delete link functionality in frontend

This commit is contained in:
2025-12-24 14:02:36 +00:00
parent c56ea8b90f
commit 52d1984478
6 changed files with 171 additions and 44 deletions

View File

@@ -79,7 +79,7 @@ export default function Home() {
type="text"
value={shortUrl}
readOnly
className="bg-white w-full max-w-md border border-stone-400 rounded-l text-center pl-20 pr-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
className="bg-white w-full max-w-md border border-stone-400 rounded-l px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<button
type="submit"
@@ -91,21 +91,10 @@ export default function Home() {
</div>
<p className="mt-4">View analytics and manage your short link at:</p>
<div className="flex justify-center w-full max-w-xl">
<input
type="text"
value={manageUrl}
readOnly
className="bg-white w-full max-w-md border border-stone-400 rounded-l text-center pl-20 pr-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<button
type="submit"
className="flex justify-center w-16 bg-red-900 text-white px-4 py-2 rounded-r hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
onClick={() => copyToClipboard(manageUrl, "manage link")}
>
<Clipboard />
</button>
</div>
<a
href={manageUrl}
className="mb-2 text-red-900 underline hover:text-red-600"
>{manageUrl}</a>
</div>
)}