feat(frontend): federation tab on own profile
This commit is contained in:
@@ -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'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't posted any public thoughts yet.
|
||||||
|
</p>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
</TabsContent>
|
||||||
|
{isOwnProfile && (
|
||||||
|
<TabsContent value="federation">
|
||||||
|
<FederationPanel />
|
||||||
|
</TabsContent>
|
||||||
|
)}
|
||||||
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user