2026-04-17 15:35:20 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { page } from '$app/stores';
|
2026-04-18 16:57:49 +02:00
|
|
|
import { Globe, Users, DatabaseBackup, Smartphone, type Icon } from 'lucide-svelte';
|
2026-04-17 15:35:20 +02:00
|
|
|
|
|
|
|
|
let { children } = $props();
|
|
|
|
|
|
2026-04-18 14:08:57 +02:00
|
|
|
const items: { href: string; label: string; icon: typeof Icon }[] = [
|
|
|
|
|
{ href: '/admin/domains', label: 'Domains', icon: Globe },
|
|
|
|
|
{ href: '/admin/profiles', label: 'Profile', icon: Users },
|
2026-04-18 16:57:49 +02:00
|
|
|
{ href: '/admin/backup', label: 'Backup', icon: DatabaseBackup },
|
|
|
|
|
{ href: '/admin/app', label: 'App', icon: Smartphone }
|
2026-04-17 15:35:20 +02:00
|
|
|
];
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<nav class="tabs">
|
|
|
|
|
{#each items as item (item.href)}
|
2026-04-18 14:08:57 +02:00
|
|
|
{@const Icon = item.icon}
|
2026-04-17 15:35:20 +02:00
|
|
|
<a
|
|
|
|
|
href={item.href}
|
|
|
|
|
class="tab"
|
|
|
|
|
class:active={$page.url.pathname.startsWith(item.href)}
|
|
|
|
|
>
|
2026-04-18 14:08:57 +02:00
|
|
|
<Icon size={16} strokeWidth={2} />
|
|
|
|
|
<span>{item.label}</span>
|
2026-04-17 15:35:20 +02:00
|
|
|
</a>
|
|
|
|
|
{/each}
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<section class="admin-body">
|
|
|
|
|
{@render children()}
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.tabs {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
padding: 0.75rem 0 0;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
|
|
}
|
|
|
|
|
.tab {
|
2026-04-18 14:08:57 +02:00
|
|
|
padding: 0.5rem 0.95rem 0.5rem 0.8rem;
|
2026-04-17 15:35:20 +02:00
|
|
|
background: white;
|
|
|
|
|
border: 1px solid #e4eae7;
|
2026-04-19 11:43:19 +02:00
|
|
|
border-radius: var(--pill-radius);
|
2026-04-17 15:35:20 +02:00
|
|
|
text-decoration: none;
|
|
|
|
|
color: #444;
|
|
|
|
|
font-size: 0.95rem;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
min-height: 40px;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
2026-04-18 14:08:57 +02:00
|
|
|
gap: 0.4rem;
|
2026-04-17 15:35:20 +02:00
|
|
|
}
|
|
|
|
|
.tab.active {
|
|
|
|
|
background: #2b6a3d;
|
|
|
|
|
color: white;
|
|
|
|
|
border-color: #2b6a3d;
|
|
|
|
|
}
|
|
|
|
|
.admin-body {
|
|
|
|
|
padding: 1rem 0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|