type fixes

This commit is contained in:
gosangam
2026-05-31 00:35:00 +05:30
parent ec20eb996b
commit 0ae3334d98
2 changed files with 35 additions and 8 deletions
+16 -1
View File
@@ -12,7 +12,7 @@
* shareable while avoiding a separate route + layout.
*/
import { useEffect, useState } from "react";
import { Suspense, useEffect, useState } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { LayoutGrid } from "lucide-react";
import { useAuth } from "@/components/auth/auth-provider";
@@ -22,6 +22,21 @@ import { ConfirmModal } from "@/components/ui/confirm-modal";
import { posts, SocialError, type Post } from "@/lib/social";
export default function MyProfilePage() {
// useSearchParams() forces a CSR bailout during prerender; the
// Suspense boundary is required by Next.js so the build doesn't fail
// (the same wrapping is in app/u/me/layout.tsx for its own check).
// The fallback matches the page's idle loading state so the brief
// moment before search params resolve doesn't flash an empty section.
return (
<Suspense
fallback={<p className="text-sm text-muted-foreground">Loading…</p>}
>
<MyProfilePageInner />
</Suspense>
);
}
function MyProfilePageInner() {
const { user } = useAuth();
const router = useRouter();
const searchParams = useSearchParams();