17 lines
862 B
Svelte
17 lines
862 B
Svelte
<script lang="ts">
|
|
import { page } from '$app/state';
|
|
|
|
let { compact = false }: { compact?: boolean } = $props();
|
|
const permissions = $derived((page.data.permissions as string[] | undefined) ?? []);
|
|
const can = (permission: string) => permissions.includes('*') || permissions.includes(permission);
|
|
const publishesDirectly = $derived(can('data.manage'));
|
|
const canSubmit = $derived(publishesDirectly || (can('data.propose') && Boolean(page.data.contributorMode?.enabled)));
|
|
</script>
|
|
|
|
{#if canSubmit}
|
|
<p class="mutation-consequence" class:compact class:direct={publishesDirectly} role="note">
|
|
<b>{publishesDirectly ? 'DIRECT PUBLISH' : 'OVERSIGHT REVIEW'}</b>
|
|
<span>{publishesDirectly ? 'Changes publish immediately and create an audit event.' : 'Saving creates a proposal; live data remains unchanged until Oversight approves it.'}</span>
|
|
</p>
|
|
{/if}
|