From 1b549c4087cb62c572e014ad4a8f267870f4f142 Mon Sep 17 00:00:00 2001 From: Ethan Swan Date: Wed, 4 Feb 2026 22:08:29 -0600 Subject: [PATCH] Add PropStatusBadge component for prop lifecycle visibility Introduce a reusable badge component that displays prop lifecycle status (open, closed, resolved-yes, resolved-no) based on deadlines and resolution. This replaces the previous resolution-only badges with more informative status indicators that show whether props are still accepting forecasts. - Add lib/prop-status.ts with getPropStatus helper function - Add PropStatusBadge component with colored variants - Add Storybook stories for visual testing - Integrate into forecast cards and prop detail page header Co-Authored-By: Claude Opus 4.5 --- app/props/[propId]/prop-page-header.tsx | 19 +-- components/forecast-card/forecast-card.tsx | 20 +--- components/ui/prop-status-badge.stories.tsx | 107 +++++++++++++++++ components/ui/prop-status-badge.tsx | 59 ++++++++++ lib/prop-status.test.ts | 121 ++++++++++++++++++++ lib/prop-status.ts | 101 ++++++++++++++++ 6 files changed, 395 insertions(+), 32 deletions(-) create mode 100644 components/ui/prop-status-badge.stories.tsx create mode 100644 components/ui/prop-status-badge.tsx create mode 100644 lib/prop-status.test.ts create mode 100644 lib/prop-status.ts diff --git a/app/props/[propId]/prop-page-header.tsx b/app/props/[propId]/prop-page-header.tsx index 1406455..78ca1c0 100644 --- a/app/props/[propId]/prop-page-header.tsx +++ b/app/props/[propId]/prop-page-header.tsx @@ -8,6 +8,8 @@ import { Button } from "@/components/ui/button"; import { ChevronLeft, CheckCircle2 } from "lucide-react"; import { ResolutionDialog } from "@/components/dialogs/resolution-dialog"; import { MarkdownRenderer } from "@/components/markdown"; +import { PropStatusBadge } from "@/components/ui/prop-status-badge"; +import { getPropStatusFromProp } from "@/lib/prop-status"; interface PropPageHeaderProps { prop: VProp; @@ -41,22 +43,7 @@ export default function PropPageHeader({ {prop.category_name} )} - - {prop.resolution === null - ? "Unresolved" - : prop.resolution - ? "Yes" - : "No"} - + {canResolve && (