21 lines
605 B
Svelte
21 lines
605 B
Svelte
<script lang="ts">
|
|
import { formatDate } from "#lib/format.js";
|
|
import { STATUS_TONE, type Status, statusText } from "./bills.js";
|
|
|
|
let { state }: { state: Status } = $props();
|
|
</script>
|
|
|
|
{#if state.kind === "paid"}
|
|
<span class="inline-flex flex-wrap gap-x-2">
|
|
{#each state.paid as paid (paid.transaction_journal_id)}
|
|
<a
|
|
class="text-income hover:underline"
|
|
href="/transactions/show/{paid.transaction_group_id}"
|
|
>✓ {formatDate(paid.date, "short")}</a
|
|
>
|
|
{/each}
|
|
</span>
|
|
{:else}
|
|
<span class={STATUS_TONE[state.kind]}>{statusText(state)}</span>
|
|
{/if}
|