use dioxus::prelude::*; use dioxus_i18n::t; use crate::components::{Bolding, UnderConstruction, H1, HR}; #[component] pub fn PublicationsProjects() -> Element { rsx! { div { class: "flex flex-col ", UnderConstruction { }, div { H1 { { t!("publications_projects_publications_title") } } Publications { }, }, HR {}, div { H1 { { t!("publications_projects_projects_title") } } Projects { }, } } } } #[derive(Clone, PartialEq, Props)] struct PublicationProp { #[props(default = "".to_string())] doi: String, authors: String, title: String, conference: String, #[props(default = "".to_string())] description: String, } fn Publications() -> Element { rsx! { div { class: "flex gap-4 items-center flex-wrap", Publication { title: t!("publications_projects_publications_rpm_title"), authors: t!("publications_projects_publications_rpm_authors"), conference: t!("publications_projects_publications_rpm_conference"), doi: t!("publications_projects_publications_rpm_url"), description: t!("publications_projects_publications_rpm_description") }, Publication { title: t!("publications_projects_publications_iot_fuzzers_title"), authors: t!("publications_projects_publications_iot_fuzzers_authors"), conference: t!("publications_projects_publications_iot_fuzzers_conference"), doi: t!("publications_projects_publications_iot_fuzzers_url"), description: t!("publications_projects_publications_iot_fuzzers_description") }, } } } fn Publication(prop: PublicationProp) -> Element { let pattern = vec!["T.-D. Tran".to_string(), "Tuan-Dat Tran".to_string()]; rsx! { Link { class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700", to:"{prop.doi}", new_tab: true, h5 { class:"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white", "{prop.title}", }, span { class: "text-lg text-gray-900 dark:text-white", "{prop.conference}" }, p { class:"font-normal text-gray-700 dark:text-gray-400 italic", Bolding { authors: "{prop.authors}", patterns: pattern, }, } p { class:"font-normal text-gray-700 dark:text-gray-400", "{prop.description}", } } } } fn Projects() -> Element { rsx! { div { class: "flex gap-4 items-center flex-wrap", Project { title: t!("publications_projects_projects_bachelorproject_title"), authors: t!("publications_projects_projects_bachelorproject_authors"), kind: t!("publications_projects_projects_bachelorproject_kind"), url: t!("publications_projects_projects_bachelorproject_url"), description: t!("publications_projects_projects_bachelorproject_description") }, Project { title: t!("publications_projects_projects_dotfiles_title"), authors: t!("publications_projects_projects_dotfiles_authors"), kind: t!("publications_projects_projects_dotfiles_kind"), url: t!("publications_projects_projects_dotfiles_url"), description: t!("publications_projects_projects_dotfiles_description") }, Project { title: t!("publications_projects_projects_homelab_title"), authors: t!("publications_projects_projects_homelab_authors"), kind: t!("publications_projects_projects_homelab_kind"), url: t!("publications_projects_projects_homelab_url"), description: t!("publications_projects_projects_homelab_description") } } } } #[derive(Clone, PartialEq, Props)] struct ProjectProp { #[props(default = "".to_string())] url: String, authors: String, title: String, kind: String, #[props(default = "".to_string())] description: String, } fn Project(prop: ProjectProp) -> Element { let pattern = vec!["T.-D. Tran".to_string(), "Tuan-Dat Tran".to_string()]; rsx! { Link { class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700", to:"{prop.url}", new_tab: true, h5 { class:"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white", "{prop.title}", }, p { class: "text-lg text-gray-900 dark:text-white", "{prop.kind}" }, p { class:"font-normal text-gray-700 dark:text-gray-400", Bolding { authors: "{prop.authors}", patterns: pattern, }, } p { class:"font-normal text-gray-700 dark:text-gray-400", "{prop.description}", } } } }