use dioxus::prelude::*; use dioxus_i18n::t; use crate::components::{Bolding, H1, HR}; #[component] pub fn PublicationsProjects() -> Element { rsx! { div { class: "flex flex-col ", 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: "/#", 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 border rounded-lg shadow bg-gray-800 border-gray-700 hover:bg-gray-700", to:"{prop.doi}", new_tab: true, h5 { class:"mb-2 text-2xl font-bold tracking-tight text-white", "{prop.title}", }, span { class: "text-lg text-white", "{prop.conference}" }, p { class:"font-normal text-gray-400 italic", Bolding { authors: "{prop.authors}", patterns: pattern, }, } p { class:"font-normal text-gray-400", "{prop.description}", } } } } fn Projects() -> Element { rsx! { div { class: "flex gap-4 items-center flex-wrap", Project { title: t!("publications_projects_projects_bpba_title"), authors: t!("publications_projects_projects_bpba_authors"), kind: t!("publications_projects_projects_bpba_kind"), url: "/#", description: t!("publications_projects_projects_bpba_description") }, Project { title: t!("publications_projects_projects_dotfiles_title"), authors: t!("publications_projects_projects_dotfiles_authors"), kind: t!("publications_projects_projects_dotfiles_kind"), 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: "/#", description: t!("publications_projects_projects_homelab_description") } Project { title: t!("publications_projects_projects_athome_title"), authors: t!("publications_projects_projects_athome_authors"), kind: t!("publications_projects_projects_athome_kind"), url: "/#", description: t!("publications_projects_projects_athome_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 border rounded-lg shadow bg-gray-800 border-gray-700 hover:bg-gray-700", to:"{prop.url}", new_tab: true, h5 { class:"mb-2 text-2xl font-bold tracking-tight text-white", "{prop.title}", }, p { class: "text-lg text-white", "{prop.kind}" }, p { class:"font-normal text-gray-400", Bolding { authors: "{prop.authors}", patterns: pattern, }, } p { class:"font-normal text-gray-400", "{prop.description}", } } } }