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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user