~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
36 lines · 1.0 KB Raw History
<script lang="ts">
	import Grant from '#lib/molecules/Grant.svelte';
	import type { Item } from '#lib/scopes';

	// What one kind of thing a scope asks for: its heading, its sentence, and
	// for a permission set, what it grants.
	let { item }: { item: Item } = $props();
</script>

<li class="permission">
	<h2>{#each item.heading as part, i (i)}{#if typeof part === 'string'}{part}{:else}<code>{part.code}</code>{/if}{/each}</h2>
	{#if item.sentence.length}<p class="sentence">{#each item.sentence as part, i (i)}{#if typeof part === 'string'}{part}{:else}<code>{part.code}</code>{/if}{/each}</p>{/if}
	{#if item.grant}<Grant grant={item.grant} />{/if}
</li>

<style>
	.permission {
		display: flex;
		flex-direction: column;
		gap: var(--space-0-5);
	}

	h2 {
		font-size: var(--text-base);
		font-weight: var(--weight-semibold);
		line-height: var(--leading-tight);
		overflow-wrap: anywhere;
	}

	.sentence {
		color: var(--mute);
		font-size: var(--text-sm);
		line-height: var(--leading-snug);
		overflow-wrap: anywhere;
	}
</style>