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 = [ const tabs = [
{ href: '/admin/reports', key: 'admin.tabs.reports' }, { href: '/admin/reports', key: 'admin.tabs.reports' },
{ href: '/admin/categories', key: 'admin.tabs.categories' }, { href: '/admin/categories', key: 'admin.tabs.categories' }
{ href: '/admin/backups', key: 'admin.tabs.backups' }
]; ];
$: current = $page.url.pathname;
function isActive(href) {
return current === href || current.startsWith(href + '/');
}
</script> </script>
<h1>{$t('admin.title')}</h1> <h1>{$t('admin.title')}</h1>
<nav class="tabs" aria-label="Admin sections"> <nav class="tabs" aria-label="Admin sections">
{#each tabs as tab} {#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)} {$t(tab.key)}
</a> </a>
{/each} {/each}