a homebrewed DnD campaign based in the Honkai: Star Rail universe
hsr honkaistarrail dnd
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add faction relationship icon

+22
+22
app/src/lib/ui/icons/RelationshipIcon.svelte
··· 1 + <script lang="ts"> 2 + import SwordsIcon from '@lucide/svelte/icons/swords' 3 + import HandshakeIcon from '@lucide/svelte/icons/handshake' 4 + import CircleMinusIcon from '@lucide/svelte/icons/circle-minus' 5 + import type { LucideIcon, LucideProps } from '@lucide/svelte' 6 + import type { factionRelationshipKind } from '$server/db/schemas/dnd/faction' 7 + 8 + type RelationshipKind = typeof factionRelationshipKind.enumValues[number] 9 + type RelationshipIconProps = LucideProps & { 10 + kind: RelationshipKind, 11 + } 12 + let { kind, ...restProps }: RelationshipIconProps = $props() 13 + 14 + const iconMap: Record<RelationshipKind, LucideIcon> = { 15 + friendly: HandshakeIcon, 16 + hostile: SwordsIcon, 17 + neutral: CircleMinusIcon, 18 + } 19 + const Icon = $derived(iconMap[kind]) 20 + </script> 21 + 22 + <Icon {...restProps} />