mod ui;
use crate::{
buildkit::{container_info::SCellContainerInfo, image_info::SCellImageInfo},
cli::ls::app::{AppInner, AppItemSuperTrait, ls::LsState, removing::RemovingState},
};
pub struct ConfirmRemoveState<Item> {
pub selected_to_remove: Item,
pub ls_state: LsState<Item>,
}
impl<Item: AppItemSuperTrait> ConfirmRemoveState<Item> {
pub fn cancel(self) -> AppInner<Item> {
AppInner::Ls(self.ls_state)
}
}
impl ConfirmRemoveState<SCellContainerInfo> {
pub fn confirm(self) -> AppInner<SCellContainerInfo> {
RemovingState::<SCellContainerInfo>::remove(self.ls_state, self.selected_to_remove)
}
}
impl ConfirmRemoveState<SCellImageInfo> {
pub fn confirm(self) -> AppInner<SCellImageInfo> {
RemovingState::<SCellImageInfo>::remove(self.ls_state, self.selected_to_remove)
}
}