feat: add url shortner

This commit is contained in:
gosangam
2026-05-11 16:14:08 +05:30
parent 179b7d8862
commit 8cd1d2e724
9 changed files with 631 additions and 8 deletions
+16
View File
@@ -0,0 +1,16 @@
"use client";
import { useEffect } from "react";
import { useRouter } from "next/navigation";
// Client-side redirect: we deliberately don't use `redirect()` from
// next/navigation on the server, because that returns a 307 before the OG
// `<head>` is ever served. With `generateMetadata` + a 200 body, social-link
// scrapers get the full OG card while real users still get redirected.
export function RedirectClient({ to }: { to: string }) {
const router = useRouter();
useEffect(() => {
router.replace(to);
}, [router, to]);
return null;
}