import type { ReviewStory } from "../api/workflow"; interface ReviewPanelProps { reviewQueue: ReviewStory[]; isReviewLoading: boolean; reviewError: string | null; proceedingStoryId: string | null; storyId: string; isGateLoading: boolean; proceedError: string | null; proceedSuccess: string | null; lastReviewRefresh: Date | null; onRefresh: () => void; onProceed: (storyId: string) => Promise; } const formatTimestamp = (value: Date | null): string => { if (!value) return "—"; return value.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit", }); }; export function ReviewPanel({ reviewQueue, isReviewLoading, reviewError, proceedingStoryId, storyId, isGateLoading, proceedError, proceedSuccess, lastReviewRefresh, onRefresh, onProceed, }: ReviewPanelProps) { return (
Stories Awaiting Review
{reviewQueue.filter((story) => story.can_accept).length} ready /{" "} {reviewQueue.length} total
Updated {formatTimestamp(lastReviewRefresh)}
{isReviewLoading ? (
Loading review queue...
) : reviewError ? (
{reviewError} Use Refresh to try again.
) : reviewQueue.length === 0 ? (
No stories waiting for review.
) : (
{reviewQueue.map((story) => (
{story.story_id}
{story.can_accept ? "Ready" : "Blocked"} {story.summary.failed > 0 && ( Failing {story.summary.failed} )} {story.warning && ( Warning )} {story.missing_categories.length > 0 && ( Missing )}
Summary: {story.summary.passed}/{story.summary.total} passing,{" "} {` ${story.summary.failed}`} failing
{story.missing_categories.length > 0 && (
Missing: {story.missing_categories.join(", ")}
)} {story.reasons.length > 0 && (
    {story.reasons.map((reason) => (
  • {reason}
  • ))}
)} {story.warning && (
{story.warning}
)}
))}
)} {proceedError && (
{proceedError}
)} {proceedSuccess && (
{proceedSuccess}
)}
); }