<script setup lang="ts">import { computed } from 'vue'; import PageLayout from '../../layouts/PageLayout.vue'; import FormPageLayout from '../../layouts/FormPageLayout.vue'; import StandardScreenBoundary from './StandardScreenBoundary.vue'; import type { StandardScreenProps } from '../../contracts/screenContract'; const props=withDefaults(defineProps<StandardScreenProps & { dirty?: boolean; readonly?: boolean }>(), { dirty: false, readonly: false }); const effectiveState = computed(() => props.readonly ? 'READONLY' : props.dirty ? 'DIRTY' : props.state); defineEmits<{submit:[];retry:[]}>()</script>
<template><PageLayout :title="props.title" :subtitle="props.subtitle" :status="effectiveState" :as-of="props.evidence?.asOf" :version="props.evidence?.version"><template #actions><slot name="actions"/></template><StandardScreenBoundary :state="effectiveState" :warning="props.warning" @retry="$emit('retry')"><FormPageLayout @submit="$emit('submit')"><slot/><template v-if="$slots.preview" #preview><slot name="preview"/></template></FormPageLayout></StandardScreenBoundary><template v-if="$slots.footer" #footer><slot name="footer"/></template></PageLayout></template>
