use crate::{AttrMap, BasecoatProps, Children};
use std::borrow::Cow;
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub enum TooltipSide {
#[default]
Top,
Right,
Bottom,
Left,
}
impl std::fmt::Display for TooltipSide {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = match self {
TooltipSide::Top => "top",
TooltipSide::Right => "right",
TooltipSide::Bottom => "bottom",
TooltipSide::Left => "left",
};
f.write_str(s)
}
}
#[derive(BasecoatProps, Default, Clone, Debug)]
pub struct TooltipProps {
#[prop(into)]
pub content: Cow<'static, str>,
#[prop(default)]
pub side: TooltipSide,
#[prop(optional, into)]
pub class: Option<Cow<'static, str>>,
#[prop(extend)]
pub attrs: AttrMap,
pub children: Children,
}