use indexmap::IndexMap;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default)]
pub struct Page {
  #[serde(skip_serializing_if = "Option::is_none")]
  pub path: Option<String>,
  #[serde(skip_serializing_if = "Option::is_none")]
  pub title: Option<String>,
  #[serde(skip_serializing_if = "Option::is_none")]
  pub sidebar: Option<Sidebar>,
  #[serde(skip_serializing_if = "Option::is_none")]
  pub actions: Option<IndexMap<String, Action>>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default)]
pub struct Sidebar {
  #[serde(skip_serializing_if = "Option::is_none")]
  pub category: Option<String>,
  #[serde(skip_serializing_if = "Option::is_none")]
  pub priority: Option<i32>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default)]
pub struct Action {
  #[serde(skip_serializing_if = "Option::is_none")]
  pub punc: Option<String>,
  #[serde(skip_serializing_if = "Option::is_none")]
  pub navigate: Option<String>,
  #[serde(skip_serializing_if = "Option::is_none")]
  pub present: Option<String>,
}
