use crate::options::UserButtonOptions;
use crate::options::UserProfileMode;
use dioxus::prelude::*;
#[component]
pub fn UserButton(
#[props(into)]
after_sign_out_url: Option<String>,
#[props(into)]
after_switch_session_url: Option<String>,
#[props(into)]
sign_in_url: Option<String>,
show_name: Option<bool>,
default_open: Option<bool>,
#[props(into)]
user_profile_mode: Option<UserProfileMode>,
#[props(into)]
user_profile_url: Option<String>,
user_profile_props: Option<serde_json::Value>,
appearance: Option<serde_json::Value>,
#[props(default = UserButtonOptions::from_value(serde_json::Value::Null), into)]
options: UserButtonOptions,
#[props(into)]
id: Option<String>,
#[props(extends = GlobalAttributes)]
attributes: Vec<Attribute>,
#[props(default = rsx! {})]
fallback: Element,
) -> Element {
let options = options
.maybe_after_sign_out_url(after_sign_out_url)
.maybe_after_switch_session_url(after_switch_session_url)
.maybe_sign_in_url(sign_in_url)
.maybe_show_name(show_name)
.maybe_default_open(default_open)
.maybe_user_profile_mode(user_profile_mode)
.maybe_user_profile_url(user_profile_url)
.maybe_user_profile_props(user_profile_props)
.maybe_appearance(appearance)
.into_value();
super::widget::render(
super::widget::Widget::UserButton,
super::widget::WidgetProps::new(options, fallback, id, attributes),
)
}