| 1 |
<script lang="ts"> |
| 2 |
import type { Entry } from "../entries"; |
| 3 |
import { Balance, Note, Transaction } from "../entries"; |
| 4 |
import BalanceSvelte from "./Balance.svelte"; |
| 5 |
import NoteSvelte from "./Note.svelte"; |
| 6 |
import TransactionSvelte from "./Transaction.svelte"; |
| 7 |
|
| 8 |
interface Props { |
| 9 |
entry: Entry; |
| 10 |
} |
| 11 |
|
| 12 |
let { entry = $bindable() }: Props = $props(); |
| 13 |
</script> |
| 14 |
|
| 15 |
{#if entry instanceof Balance} |
| 16 |
<BalanceSvelte bind:entry /> |
| 17 |
{:else if entry instanceof Note} |
| 18 |
<NoteSvelte bind:entry /> |
| 19 |
{:else if entry instanceof Transaction} |
| 20 |
<TransactionSvelte bind:entry /> |
| 21 |
{:else} |
| 22 |
Entry type unsupported for editing. |
| 23 |
{/if} |