your personal website on atproto - mirror
blento.app
1<script lang="ts">
2 import { CardDefinitionsByType } from '..';
3 import { type BaseCardProps } from '../BaseCard/BaseCard.svelte';
4
5 let { item, ref = $bindable(null), ...rest }: BaseCardProps = $props();
6</script>
7
8{#if CardDefinitionsByType[item.cardType]}
9 {@const cardDef = CardDefinitionsByType[item.cardType]}
10 <cardDef.contentComponent {item} {...rest} />
11{:else}
12 <div class="m-4">Unsupported card type: {item.cardType}</div>
13{/if}