"""Block render results: display-only (informational) vs prompt-and-collect (await_user)."""

from __future__ import annotations

from collections.abc import Callable
from dataclasses import dataclass

from rich.console import Console, RenderableType


@dataclass(frozen=True)
class InformationalResult:
    """Block that only displays output. No user input."""

    renderable: RenderableType
    """Rich renderable to print (Table, Text, Markdown, etc.)."""


@dataclass(frozen=True)
class AwaitUserResult:
    """Block that prompts for input. Prompt handles all display."""

    collect_input: Callable[[Console], str]
    """Called to show prompt and return the collected user input string."""


BlockResult = InformationalResult | AwaitUserResult
"""Result of rendering a block: either display-only or prompt-and-collect."""
