clin-rs 0.8.12

Encrypted terminal note-taking app inspired by Obsidian
use super::Action;
use crate::app::App;
use anyhow::Result;
use std::borrow::Cow;

pub struct CreateDrawAction;

impl Action for CreateDrawAction {
    fn id(&self) -> Cow<'static, str> {
        Cow::Borrowed("draw.create")
    }

    fn name(&self) -> Cow<'static, str> {
        Cow::Borrowed("Create Drawing")
    }

    fn description(&self) -> Cow<'static, str> {
        Cow::Borrowed("Create a new drawing file")
    }
    fn category(&self) -> super::ActionCategory {
        super::ActionCategory::Views
    }

    fn glyph(&self) -> &'static str {
        "\u{f1fc}"
    }

    fn execute(&self, app: &mut App, _context_note_id: Option<&str>) -> Result<()> {
        app.begin_create_draw();
        Ok(())
    }
}