use crate::{ grid::config::ColoredConfig, grid::records::{ExactRecords, Records, RecordsMut, Resizable}, settings::TableOption, }; use super::Panel; /// Footer renders a [`Panel`] at the bottom. /// See [`Panel`]. #[derive(Debug)] pub struct Footer(S); impl Footer { /// Creates a new object. pub fn new(text: S) -> Self where S: AsRef, { Self(text) } } impl TableOption for Footer where S: AsRef, R: Records + ExactRecords + Resizable + RecordsMut, { fn change(self, records: &mut R, cfg: &mut ColoredConfig, dimension: &mut D) { Panel::horizontal(records.count_rows(), self.0.as_ref()).change(records, cfg, dimension); } }