feat(frontend): federation tab on own profile

This commit is contained in:
2026-05-15 04:14:56 +02:00
parent cb413ee6e9
commit 9df1a55c48

View File

@@ -53,6 +53,8 @@ import { buildThoughtThreads } from "@/lib/utils";
import { ThoughtThread } from "@/components/thought-thread"; import { ThoughtThread } from "@/components/thought-thread";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import Link from "next/link"; import Link from "next/link";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { FederationPanel } from "@/components/federation/federation-panel";
interface ProfilePageProps { interface ProfilePageProps {
params: Promise<{ username: string }>; params: Promise<{ username: string }>;
@@ -250,24 +252,39 @@ export default async function ProfilePage({ params }: ProfilePageProps) {
id="profile-card__thoughts" id="profile-card__thoughts"
className="col-span-1 lg:col-span-3 space-y-4" className="col-span-1 lg:col-span-3 space-y-4"
> >
{thoughtThreads.map((thought) => ( <Tabs defaultValue="thoughts">
<ThoughtThread <TabsList className="mb-4">
key={thought.id} <TabsTrigger value="thoughts">Thoughts</TabsTrigger>
thought={thought} {isOwnProfile && (
authorDetails={authorDetails} <TabsTrigger value="federation">Federation</TabsTrigger>
currentUser={me} )}
/> </TabsList>
))} <TabsContent value="thoughts" className="space-y-4">
{thoughtThreads.length === 0 && ( {thoughtThreads.map((thought) => (
<Card <ThoughtThread
id="profile-card__no-thoughts" key={thought.id}
className="flex items-center justify-center h-48" thought={thought}
> authorDetails={authorDetails}
<p className="text-center text-muted-foreground"> currentUser={me}
This user hasn&apos;t posted any public thoughts yet. />
</p> ))}
</Card> {thoughtThreads.length === 0 && (
)} <Card
id="profile-card__no-thoughts"
className="flex items-center justify-center h-48"
>
<p className="text-center text-muted-foreground">
This user hasn&apos;t posted any public thoughts yet.
</p>
</Card>
)}
</TabsContent>
{isOwnProfile && (
<TabsContent value="federation">
<FederationPanel />
</TabsContent>
)}
</Tabs>
</div> </div>
</main> </main>
</div> </div>