fix admin tabs

This commit is contained in:
2026-09-12 21:31:48 +05:00
parent 1e91de5a0e
commit 390c4fb4ea
+2 -8
View File
@@ -4,21 +4,15 @@
const tabs = [
{ href: '/admin/reports', key: 'admin.tabs.reports' },
{ href: '/admin/categories', key: 'admin.tabs.categories' },
{ href: '/admin/backups', key: 'admin.tabs.backups' }
{ href: '/admin/categories', key: 'admin.tabs.categories' }
];
$: current = $page.url.pathname;
function isActive(href) {
return current === href || current.startsWith(href + '/');
}
</script>
<h1>{$t('admin.title')}</h1>
<nav class="tabs" aria-label="Admin sections">
{#each tabs as tab}
<a href={tab.href} class:active={isActive(tab.href)} aria-current={isActive(tab.href) ? 'page' : undefined}>
<a href={tab.href}>
{$t(tab.key)}
</a>
{/each}