'use client'; import { useState } from 'react'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import type { Task } from '@/types'; interface Props { task: Task | null; isLoading: boolean; streamingContent: string; } export default function TaskCard({ task, isLoading, streamingContent }: Props) { const [collapsed, setCollapsed] = useState(false); if (!isLoading && !task) return null; return (
{!collapsed && (
{isLoading ? (
{/* Skeleton shimmer while task streams in */} {streamingContent ? (

{streamingContent}

) : ( <>
)}
) : task ? (

{children}

, ul: ({ children }) =>
    {children}
, li: ({ children }) =>
  • {children}
  • , strong: ({ children }) => {children}, code: ({ children }) => ( {children} ), }} > {task.description}
    {task.hints.length > 0 && (

    Hints

      {task.hints.map((hint, i) => (
    • {hint}
    • ))}
    )}
    ) : null}
    )}
    ); }