feat: hide post

This commit is contained in:
gosangam
2026-06-14 19:52:16 +05:30
parent 7585e6cb31
commit 79f0bd9223
5 changed files with 154 additions and 2 deletions
+12
View File
@@ -18,6 +18,7 @@ import { useRouter, useSearchParams } from "next/navigation";
import {
AtSign,
Bookmark,
EyeOff,
FolderClosed,
LayoutGrid,
} from "lucide-react";
@@ -51,6 +52,7 @@ export default function MeLayout({ children }: { children: React.ReactNode }) {
posts: number;
followers: number;
following: number;
hidden: number;
} | null>(null);
const handle = user?.handle;
useEffect(() => {
@@ -64,6 +66,7 @@ export default function MeLayout({ children }: { children: React.ReactNode }) {
posts: p.post_count,
followers: p.follower_count,
following: p.following_count,
hidden: p.hidden_count ?? 0,
});
}
})
@@ -109,6 +112,15 @@ export default function MeLayout({ children }: { children: React.ReactNode }) {
},
];
// Surface the "Hidden" tab only when the user actually has hidden posts.
if ((counts?.hidden ?? 0) > 0) {
tabs.push({
href: "/u/me/hidden",
label: "Hidden",
icon: <EyeOff className="size-5" />,
});
}
return (
<main className="flex-1 max-w-3xl w-full mx-auto px-4 sm:px-6">
<ProfileHeader