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
use dioxus::prelude::*;
#[component]
pub fn ImageHero(
title: String,
subtitle: String,
image: String,
cta_label: Option<String>,
cta_href: Option<String>,
class: Option<String>,
) -> Element {
let cta_label = cta_label.unwrap_or_else(|| "Book a Call".to_string());
let class = class.unwrap_or_default();
rsx! {
section {
class: class,
div {
class: "flex flex-col md:flex-row gap-8 text-center md:text-left",
div {
class: "flex-1",
div {
h1 {
class: "font-display text-2xl md:text-6xl font-bold",
"{title}"
}
}
}
div {
class: "flex-1",
img {
src: "{image}"
}
}
}
div {
class: "text-center",
p {
class: "py-6",
"{subtitle}"
}
div {
if let Some(cta_href) = cta_href {
a {
class: "btn btn-secondary",
href: cta_href,
"{cta_label}"
}
}
}
}
}
}
}