"""Progress indicator showing the current position within the card stack."""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/components/progress.ipynb.

# %% auto #0
__all__ = ['render_progress_indicator']

# %% ../../nbs/components/progress.ipynb #p1000003
from typing import Any

from fasthtml.common import Div, Span

# DaisyUI utilities
from cjm_fasthtml_daisyui.utilities.semantic_colors import text_dui

# Tailwind utilities
from cjm_fasthtml_tailwind.utilities.typography import font_size, font_family
from cjm_fasthtml_tailwind.core.base import combine_classes

# Local imports
from ..core.html_ids import CardStackHtmlIds

# %% ../../nbs/components/progress.ipynb #p1000005
def render_progress_indicator(
    focused_index: int,  # Currently focused item index (0-based)
    total_items: int,  # Total number of items
    ids: CardStackHtmlIds,  # HTML IDs for this card stack instance
    label: str = "Item",  # Label prefix (e.g., "Item", "Segment", "Card")
    oob: bool = False,  # Whether to render as OOB swap
) -> Any:  # Progress indicator component
    """Render position indicator showing current item in the collection."""
    current = focused_index + 1

    return Div(
        Span(
            f"{label} {current:,} of {total_items:,}",
            cls=combine_classes(
                font_size.sm, font_family.mono,
                text_dui.base_content.opacity(70)
            )
        ),
        id=ids.progress,
        hx_swap_oob="true" if oob else None
    )
