File size: 1,056 Bytes
1943883 e46883d 1943883 e46883d 1943883 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | """Journey state progress indicator component."""
from __future__ import annotations
from app.services.state_manager import JOURNEY_STATES
_STEP_LABELS = {
"INGEST": "Upload Documents",
"PRESCREEN": "Review Profile",
"VALIDATE_TRIALS": "Trial Matching",
"GAP_FOLLOWUP": "Gap Analysis",
"SUMMARY": "Summary & Export",
}
def render_progress_tracker(current_state: str) -> dict:
"""Produce a render-spec dict for the journey progress indicator."""
current_idx = JOURNEY_STATES.index(current_state) if current_state in JOURNEY_STATES else 0
steps = []
for i, state in enumerate(JOURNEY_STATES):
if i < current_idx:
status = "completed"
elif i == current_idx:
status = "current"
else:
status = "upcoming"
steps.append(
{
"state": state,
"label": _STEP_LABELS[state],
"status": status,
}
)
return {
"steps": steps,
"current_index": current_idx,
}
|