1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#![allow(non_snake_case)]
use super::button::{Button, ButtonScheme};
use dioxus::prelude::*;
#[derive(Props, Clone, PartialEq)]
pub struct BlankSlateProps {
heading: String,
visual: String,
description: String,
primary_action: Option<(String, String)>,
primary_action_drawer: Option<(String, String)>,
secondary_action: Option<(String, String)>,
}
#[component]
pub fn BlankSlate(props: BlankSlateProps) -> Element {
rsx!(
div {
class: "mt-4 flex flex-col justify-center items-center",
img {
class: "mb-4 svg-icon",
src: "{props.visual}",
width: "100px",
height: "100px"
}
h2 {
class: "text-center mb-4 max-w-prose",
"{props.heading}"
}
p {
class: "mb-4 max-w-prose text-center",
"{props.description}"
}
match &props.primary_action {
Some(pa) => rsx!(
div {
a {
href: "{pa.1}",
span {
class: "Button-label",
"{pa.0}"
}
}
}
),
None => rsx!()
}
match props.primary_action_drawer {
Some(pa) => rsx!(
div {
Button {
button_scheme: ButtonScheme::Primary,
popover_target: "{pa.1}",
"{pa.0}"
}
}
),
None => rsx!()
}
match props.secondary_action {
Some(pa) => rsx!(
div {
a {
href: "{pa.1}",
"{pa.0}"
}
}
),
None => rsx!()
}
}
)
}