pub(crate) mod library;
pub(crate) mod onboarding;
pub(crate) mod reader;

use super::{app::AppCommand, RefreshHint};

pub(crate) struct ScreenUpdate<A> {
    pub dirty: bool,
    pub refresh: RefreshHint,
    pub action: A,
    pub command: Option<AppCommand>,
}

impl<A> ScreenUpdate<A> {
    pub fn new(dirty: bool, refresh: RefreshHint, action: A) -> Self {
        Self {
            dirty,
            refresh,
            action,
            command: None,
        }
    }

    pub fn with_command(dirty: bool, refresh: RefreshHint, action: A, command: AppCommand) -> Self {
        Self {
            dirty,
            refresh,
            action,
            command: Some(command),
        }
    }
}
