Files
phishingclub/frontend/src/lib/components/DashboardNav.svelte
T
2026-02-19 00:11:38 +01:00

40 lines
1.5 KiB
Svelte

<script>
import { page } from '$app/stores';
// determine active tab based on current route
// normalize path to handle trailing slashes
$: currentPath = $page.url.pathname.replace(/\/$/, '') || '/';
</script>
<nav class="mt-4 mb-6 border-b border-gray-200 dark:border-gray-700">
<div class="flex">
<a
href="/dashboard"
class="px-6 py-3 text-sm font-medium border-b-2 transition-colors
{currentPath === '/dashboard'
? 'border-cta-blue dark:border-highlight-blue text-cta-blue dark:text-highlight-blue'
: 'border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600'}"
>
Overview
</a>
<a
href="/dashboard/campaigns"
class="px-6 py-3 text-sm font-medium border-b-2 transition-colors
{currentPath === '/dashboard/campaigns'
? 'border-cta-blue dark:border-highlight-blue text-cta-blue dark:text-highlight-blue'
: 'border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600'}"
>
Campaigns
</a>
<a
href="/dashboard/events"
class="px-6 py-3 text-sm font-medium border-b-2 transition-colors
{currentPath === '/dashboard/events'
? 'border-cta-blue dark:border-highlight-blue text-cta-blue dark:text-highlight-blue'
: 'border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600'}"
>
Events
</a>
</div>
</nav>