use leptos::*;

use crate::domain::api::prelude::User;

/// Renders the home page of your application.
#[component]
pub fn DashboardPage(user: User) -> impl IntoView {
    view! {
        <section class="login is-fullheight">
            <div class="columns is-fullheight">
                <div class="column is-one-third-fullhd is-half-widescreen">
                    <div class="login_container">
                        <div style="margin: auto 0">
                            <div class="has-text-centered">
                                <img src="/android-chrome-192x192.png" alt={ crate::PROJECT_NAME }/>
                            </div>

                            <pre>Hello, { user.email().to_string() }!</pre>
                            <div class="content has-text-centered">
                                <a href="/auth/logout">Logout</a>
                            </div>

                        </div>

                        <footer>
                            <div class="content has-text-centered">
                                <p>
                                    { crate::PROJECT_NAME }
                                </p>
                                <p>
                                    <span class="icon"><a href="https://git.avii.nl/AVAM/avam" class="is-link" target="_BLANK"><i class="fab fa-git-alt"></i></a></span>
                                    <span class="icon"><a href="#" class="is-link" target="_BLANK"><i class="fab fa-discord"></i></a></span>
                                </p>
                            </div>
                        </footer>

                    </div>

                </div>

                <div class="column is-fullheight background is-hidden-mobile has-background-primary has-text-primary-invert">
                </div>
            </div>
        </section>
    }.into_view()
}
