use yew::prelude::*;
#[derive(Clone)]
pub enum ActionType {
Primary,
Secondary,
}
impl ToString for ActionType {
fn to_string(&self) -> String {
match self {
ActionType::Primary => "primaryAction",
ActionType::Secondary => "secondaryAction",
}
.to_string()
}
}
#[derive(Properties, Clone)]
pub struct ActionProps {
pub action_type: ActionType,
#[prop_or_default]
pub action: Option<String>,
pub children: Children,
}
pub struct DialogAction {
props: ActionProps,
}
impl Component for DialogAction {
type Message = ();
type Properties = ActionProps;
fn create(props: Self::Properties, _: ComponentLink<Self>) -> Self {
Self { props }
}
fn update(&mut self, _msg: Self::Message) -> bool {
false
}
fn change(&mut self, props: Self::Properties) -> bool {
self.props = props;
true
}
fn view(&self) -> Html {
unimplemented!()
}
}