Initial commit

This commit is contained in:
Jarek Krochmalski
2025-12-28 21:16:03 +01:00
commit 62e3c6439e
552 changed files with 104858 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<script lang="ts">
import { authStore, canAccess } from '$lib/stores/auth';
import type { Snippet } from 'svelte';
interface Props {
resource: string;
action: string;
children: Snippet;
fallback?: Snippet;
}
let { resource, action, children, fallback }: Props = $props();
// Check if user can access the resource/action
const hasAccess = $derived($canAccess(resource, action));
</script>
{#if hasAccess}
{@render children()}
{:else if fallback}
{@render fallback()}
{/if}