<script lang="ts">
	import { NavbarObject } from "../classes/NavObject";
	import { Navbar, NavBrand, NavLi, NavUl, NavHamburger, DarkMode } from 'flowbite-svelte';
	export let navobjs: NavbarObject[] = [new NavbarObject('#', 'No nav elements provided')];
	export let pageTitle: string = "Default Title";
	export let toggleDarkModeButton: boolean = true;
</script>
<Navbar let:hidden let:toggle color="form" navDivClass="mx-auto flex flex-wrap justify-around items-center">
	<NavBrand href="/">
    	<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">
			{ pageTitle.toUpperCase() }
		</span>
	</NavBrand>
	<NavHamburger on:click={toggle} />
	<div class="flex">
		<NavUl {hidden}>
			{#each navobjs as navElem}
				<NavLi href="{ navElem.link }">{ navElem.text }</NavLi>
			{/each}
		</NavUl>
		{#if toggleDarkModeButton}
			<DarkMode class='p-0' />
		{/if}
	</div>
</Navbar>
