use super::super::super::app::{ActionState, RowKey};
pub(in crate::lookout::view) const READ_ONLY_LABEL: &str = "read-only";
pub(in crate::lookout::view) const CONTROL_ENABLED_LABEL: &str = "control enabled";
pub(super) fn confirm_prompt(action: &ActionState<'_>) -> String {
match action.target {
RowKey::Sheep(id) => format!(
"{} {} (id {id})? enter confirms, any other key cancels",
action.verb.label(),
action.name
),
RowKey::Group(name) => {
let count = action.count;
format!(
"{} all {count} instances of {name}? enter confirms, any other key cancels",
action.verb.label()
)
}
RowKey::Fold(name) => format!(
"{} all {} sheep in fold {name}? enter confirms, any other key cancels",
action.verb.label(),
action.count
),
RowKey::Section(_) => unreachable!("a header is never an action target"),
}
}
pub(super) fn in_flight_text(action: &ActionState<'_>) -> String {
match action.target {
RowKey::Sheep(id) => format!(
"{} {} (id {id}): sent, waiting for the shepherd",
action.verb.label(),
action.name
),
RowKey::Group(name) => format!(
"{} all {} instances of {name}: sent, waiting for the shepherd",
action.verb.label(),
action.count
),
RowKey::Fold(name) => format!(
"{} all {} sheep in fold {name}: sent, waiting for the shepherd",
action.verb.label(),
action.count
),
RowKey::Section(_) => unreachable!("a header is never an action target"),
}
}