---
import AdminLayout from '@layouts/admin/AdminLayout.astro';
import Users from '@app/admin/users/Users.svelte';
import SidebarActions from '@app/admin/users/SidebarActions.svelte';
import { Session } from '@util/session.ts';
import { Permissions } from '@util/permissions.ts';
import { BASE_PATH } from 'astro:env/server';

const session = Session.sessionFromCookies(Astro.cookies, Permissions.Users);
if (!session) return Astro.redirect(`${BASE_PATH}/admin`);
---

<AdminLayout title="Registrierte Nutzer">
  <SidebarActions slot="actions" client:load />
  <Users client:load />
</AdminLayout>
