use crate::{AttrMap, BasecoatProps};
use std::borrow::Cow;
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub enum TabsOrientation {
#[default]
Horizontal,
Vertical,
}
impl std::fmt::Display for TabsOrientation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TabsOrientation::Horizontal => f.write_str("horizontal"),
TabsOrientation::Vertical => f.write_str("vertical"),
}
}
}
#[derive(Clone, Debug, Default)]
pub struct TabSet {
pub tab: Cow<'static, str>,
pub panel: Option<Cow<'static, str>>,
}
#[derive(BasecoatProps, Default, Clone, Debug)]
pub struct TabsProps {
#[prop(optional, into)]
pub id: Option<Cow<'static, str>>,
#[prop(default)]
pub tabsets: Vec<TabSet>,
#[prop(default = 1usize)]
pub default_tab_index: usize,
#[prop(default)]
pub orientation: TabsOrientation,
#[prop(optional, into)]
pub class: Option<Cow<'static, str>>,
#[prop(extend)]
pub attrs: AttrMap,
}