use leptos::*;

#[component]
pub fn ProjectList(
    children: Children
) -> impl IntoView {
    view! {
        <div class="project_list">
            { children() }
        </div>
    }
}

#[component]
pub fn ProjectElement(
    children: Children,
    #[prop(optional)]
    image_src: Option<String>,
    #[prop(optional)]
    url: Option<String>
) -> impl IntoView {
    view! {
        <a href=url target="_blank">
            { image_src.map(|src| view! { <img src=src/> }) }
            <div><p>{ children() }</p></div>
        </a>
    }
}