euv_ui/component/timeline/view/struct.rs
1use super::*;
2
3/// One entry of the [`euv_timeline`] event log.
4///
5/// A timeline item is a headline, an optional body, and an optional
6/// timestamp. The empty fields are skipped at render time so a terse
7/// one-line entry does not leave an empty gap in the column.
8#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
9pub struct EuvTimelineItem {
10 /// The entry headline rendered in `c_euv_timeline_title`.
11 #[get(type(copy))]
12 pub title: &'static str,
13 /// The optional entry body rendered in `c_euv_timeline_desc`.
14 #[get(type(copy))]
15 pub description: &'static str,
16 /// The optional timestamp rendered in the monospace
17 /// `c_euv_timeline_time` style (skipped when empty).
18 #[get(type(copy))]
19 pub time: &'static str,
20}
21
22/// Props for the [`euv_timeline`] component.
23///
24/// Defines the strongly-typed interface for a vertical event log. The
25/// entries are ordered oldest-first, matching the reading direction of the
26/// rail that connects them.
27#[derive(Clone, CustomDebug, Data, Default, New)]
28pub struct EuvTimelineProps {
29 /// The ordered event entries; an empty list renders an empty column.
30 pub items: Vec<EuvTimelineItem>,
31}