//! The sidebar is (mostly) the [`Relation`]-level navigation of the app.

use ratatui::widgets::{Table, TableState};
use tui_dialog::Dialog;

use crate::relations::Relation;

/// How wide the sidebar should be.
pub const SIDEBAR_SIZE: u16 = 65;
pub const MIN_COLUMN_WIDTH: u16 = 7;

/// Relation type filter.
#[derive(Clone, Copy)]
pub enum RelationTypeFilter {
    All,
    Table,
    Sequence,
    View,
}

/// All non-system schemas or public schema.
pub enum SchemaFilter {
    All,
    Public,
}

pub struct Sidebar<'st> {
    pub table: Option<Table<'st>>,
    pub table_state: TableState,
    pub current_relations: Vec<Relation>,
    pub relation_type_filter: RelationTypeFilter,
    pub schema_filter: SchemaFilter,
    pub relation_name_dialog: Dialog,
}
