paiagram/interface/side_panel/
station_stats.rs

1use bevy::ecs::{
2    entity::Entity,
3    name::Name,
4    query::With,
5    system::{In, InMut, Query},
6};
7use egui::Ui;
8use moonshine_core::kind::Instance;
9
10use crate::graph::Station;
11
12pub fn show_station_stats(
13    (InMut(ui), In(station_entity)): (InMut<Ui>, In<Instance<Station>>),
14    station_name: Query<&Name, With<Station>>,
15) {
16    // Display basic statistics and edit functions
17    ui.heading(
18        station_name
19            .get(station_entity.entity())
20            .map_or("Unknown", Name::as_str),
21    );
22}