import type { UpcomingStory } from "../api/workflow"; interface UpcomingPanelProps { stories: UpcomingStory[]; isLoading: boolean; error: string | null; lastRefresh: Date | null; onRefresh: () => void; } const formatTimestamp = (value: Date | null): string => { if (!value) return "—"; return value.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit", }); }; export function UpcomingPanel({ stories, isLoading, error, lastRefresh, onRefresh, }: UpcomingPanelProps) { return (
Upcoming Stories
{stories.length} stories
Updated {formatTimestamp(lastRefresh)}
{isLoading ? (
Loading upcoming stories...
) : error ? (
{error} Use Refresh to try again.
) : stories.length === 0 ? (
No upcoming stories.
) : (
{stories.map((story) => (
{story.name ?? story.story_id}
{story.name && (
{story.story_id}
)}
{story.error && (
{story.error}
)}
))}
)}
); }