type fixes
This commit is contained in:
+16
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user