diff --git a/src/components/page/hero.rs b/src/components/page/hero.rs
index e97afe4..9721dab 100644
--- a/src/components/page/hero.rs
+++ b/src/components/page/hero.rs
@@ -1,27 +1,38 @@
+use realtor_lp_types::domain::realtor::Realtor;
use yew::prelude::*;
+#[derive(PartialEq, Properties)]
+pub struct HeroSectionProps {
+ pub realtor: Realtor
+}
+
#[function_component(HeroSection)]
-pub fn hero_section() -> Html {
+pub fn hero_section(props: &HeroSectionProps) -> Html {
+
html! {
-
+
url,
+ None => "images/agent-banner.png".to_string()
+ }} alt="realtor-banner-image"/>
-
+
- {"Brooklyn Simmons"}
+ {props.realtor.name.clone()}
- {"Agent"}
+ {"Director Regional Remax Metropolitana RD"}
- {"About me"}
+ {"Sobre mí"}
- {"Lorem ipsum dolor sit amet consectetur. Mauris sapien arcu ac quis eget sed nullam. Facilisi odio leo non lectus tincidunt orci dictum sed. Id vulputate maecenas scelerisque pellentesque rhoncus at ullamcorper."}
+ {props.realtor.bio.clone()}
diff --git a/src/components/page/results.rs b/src/components/page/results.rs
index ae21dfe..9794dce 100644
--- a/src/components/page/results.rs
+++ b/src/components/page/results.rs
@@ -2,5 +2,10 @@ use yew::prelude::*;
#[function_component(ResultsSection)]
pub fn results_section() -> Html {
- html! {}
+
+ html! {
+
+
+
+ }
}
diff --git a/src/pages/main_page.rs b/src/pages/main_page.rs
index e77d021..ed96d35 100644
--- a/src/pages/main_page.rs
+++ b/src/pages/main_page.rs
@@ -1,18 +1,48 @@
+use std::str::FromStr;
+
+use uuid::Uuid;
use yew::prelude::*;
-use crate::components::{
+use crate::{components::{
footer::Footer,
page::{
agency::AgencySection, contact::ContactSection, hero::HeroSection, results::ResultsSection,
search::SearchSection,
},
-};
+}, api::backend};
#[function_component(MainPage)]
pub fn main_page() -> Html {
+ let realtor_id = Uuid::from_str("544eac57-a80d-457e-9ee8-7ec14b2bebd0").unwrap();
+ let realtor_handle = use_state(|| None);
+ use_state(|| {
+ let realtor_handle = realtor_handle.clone();
+ wasm_bindgen_futures::spawn_local(async move {
+ realtor_handle.set(match backend::get_realtor_profile(realtor_id).await {
+ Ok(realtor) => Some(realtor),
+ Err(error) => {
+ log::error!("Error getting realtor_handle: {error}");
+ None
+ },
+ });
+ });
+ });
+
+
html! {
-
+ {
+ if let Some(realtor) = (*realtor_handle).clone() {
+ html! {
+
+ }
+ } else {
+ html! {
+
+ }
+ }
+ }
+