2025-10-06 18:23:19 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {ComponentProps} from "svelte"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {ZapGoal} from "@welshman/domain"
|
2025-10-06 18:23:19 +00:00
|
|
|
import Bolt from "@assets/icons/bolt.svg?dataurl"
|
|
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import ContentMinimal from "@app/components/ContentMinimal.svelte"
|
2026-09-21 20:25:01 +00:00
|
|
|
import {reader} from "@app/core"
|
|
|
|
|
import {deriveGoalProgress} from "@app/goals"
|
2025-10-06 18:23:19 +00:00
|
|
|
|
|
|
|
|
const props: ComponentProps<typeof ContentMinimal> = $props()
|
|
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const goal = reader(ZapGoal)(props.event)
|
2025-10-06 18:23:19 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const title = goal.title()
|
|
|
|
|
const summaryEvent = $derived({content: goal.summary(), tags: props.event.tags})
|
|
|
|
|
|
2026-09-21 20:25:01 +00:00
|
|
|
const progress = deriveGoalProgress(props.event, props.url)
|
2025-10-06 18:23:19 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="flex justify-between">
|
2026-07-28 16:16:26 +00:00
|
|
|
<span class="text-sm">{title}</span>
|
2025-10-06 18:23:19 +00:00
|
|
|
<div class="flex items-center gap-1">
|
|
|
|
|
<Icon icon={Bolt} size={4} />
|
2026-09-21 20:25:01 +00:00
|
|
|
{$progress.raised.toLocaleString()}/{$progress.target.toLocaleString()} sats funded
|
2025-10-06 18:23:19 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-07-28 16:16:26 +00:00
|
|
|
<ContentMinimal {...props} event={summaryEvent} />
|