feat: Show project pills on initiative cards in list view

Add projects to the listInitiatives tRPC response and render them as
outline badge pills between the initiative name and activity row.
This commit is contained in:
Lukas May
2026-03-06 13:06:33 +01:00
parent 243f24a397
commit b6218584ee
2 changed files with 29 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { MoreHorizontal } from "lucide-react";
import { Card } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import {
DropdownMenu,
DropdownMenuContent,
@@ -20,6 +21,7 @@ export interface SerializedInitiative {
branch: string | null;
createdAt: string;
updatedAt: string;
projects?: Array<{ id: string; name: string }>;
activity: {
state: string;
activePhase?: { id: string; name: string };
@@ -113,6 +115,17 @@ export function InitiativeCard({ initiative, onClick }: InitiativeCardProps) {
</div>
</div>
{/* Project pills */}
{initiative.projects && initiative.projects.length > 0 && (
<div className="mt-1.5 flex flex-wrap gap-1">
{initiative.projects.map((p) => (
<Badge key={p.id} variant="outline" size="xs" className="font-normal">
{p.name}
</Badge>
))}
</div>
)}
{/* Row 2: Activity dot + label + active phase + progress */}
<div className="mt-1.5 flex items-center gap-3">
<StatusDot