25 lines
575 B
Svelte
25 lines
575 B
Svelte
<script lang="ts" module>
|
|
export interface Status {
|
|
tone: 'ok' | 'danger';
|
|
text: string;
|
|
}
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
/**
|
|
* A form's result, shown after its buttons in the same row. It's always there (empty when
|
|
* there's nothing to say), so a message appearing never moves anything.
|
|
*/
|
|
let { status }: { status: Status | null | undefined } = $props();
|
|
</script>
|
|
|
|
<p class="action-status small tone-{status?.tone ?? 'ok'}" role="status">{status?.text ?? ''}</p>
|
|
|
|
<style>
|
|
.action-status {
|
|
flex: 1 1 14rem;
|
|
min-width: 0;
|
|
color: var(--tone);
|
|
}
|
|
</style>
|