Skip to main content

euv_ui/component/steps/view/
struct.rs

1use super::*;
2
3/// One entry of the [`euv_steps`] progress stepper.
4///
5/// A step is a title plus an optional description; its position relative
6/// to [`EuvStepsProps::current`] — not a per-step flag — decides whether
7/// it renders as pending, active, or already done.
8#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
9pub struct EuvStep {
10    /// The step name rendered in `c_euv_step_title`.
11    #[get(type(copy))]
12    pub title: &'static str,
13    /// The optional sub-copy rendered in `c_euv_step_desc`.
14    #[get(type(copy))]
15    pub description: &'static str,
16}
17
18/// Props for the [`euv_steps`] component.
19///
20/// The progress position is owned by the caller through a `Signal<usize>`
21/// so advancing the stepper re-renders only the marker and class of each
22/// step instead of rebuilding the list.
23#[derive(Clone, CustomDebug, Data, Default, New)]
24pub struct EuvStepsProps {
25    /// The ordered steps to render; an empty list renders an empty row.
26    pub steps: Vec<EuvStep>,
27    /// The index of the step currently in progress.
28    #[get(type(copy))]
29    pub current: Signal<usize>,
30}