blob: f1d80c196b2bef6207ddde0f68467bc69b278009 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// rocie - An enterprise grocery management system - Web app
//
// Copyright (C) 2026 Benedikt Peetz <benedikt.peetz@b-peetz.de>
// SPDX-License-Identifier: GPL-3.0-or-later
//
// This file is part of Rocie.
//
// You should have received a copy of the License along with this program.
// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
use icondata_core::Icon as DataIcon;
use leptos::prelude::{ClassAttribute, ElementChild, IntoView, OnAttribute, component, view};
use leptos_icons::Icon;
use leptos_router::{NavigateOptions, hooks::use_navigate};
#[component]
pub fn SiteHeader(
logo: DataIcon,
back_location: &'static str,
name: &'static str,
#[prop(default = None)] menu: Option<String>,
) -> impl IntoView {
let navigate = use_navigate();
view! {
<div
class="flex flex-row justify-between items-center p-2 px-4 w-full h-1/12 bg-gray-100"
on:click=move |_| {
navigate(back_location, NavigateOptions::default());
}
>
<div class="max-w-14">
<Icon icon=logo />
</div>
<p class="text-xl">{name}</p>
<div>{menu}</div>
</div>
}
}
|