<script lang="ts">
    import {locals} from "../ts/stores";
    import {route, hasRoute, hasAnyRoute} from "../../common/Routing";
    import BaseTemplate from "./templates/BaseTemplate.svelte";
</script>

<BaseTemplate title="{$locals.app.name}" h1={false}>
    <div class="panel">
        <h1>swaf - Svelte Web Application Framework</h1>
        <p>Welcome to {$locals.app.name}!</p>

        {#if hasAnyRoute('tests', 'design')}
        <nav>
            <ul>
                {#if hasRoute('tests')}
                <li><a href={route('tests')}>Frontend tests</a></li>
                {/if}
                {#if hasRoute('design')}
                <li><a href={route('design')}>Design test</a></li>
                {/if}
            </ul>
        </nav>
        {/if}
    </div>
</BaseTemplate>
