flotilla/src/app/components/ThunkStatusDetail.svelte

32 lines
713 B
Svelte
Raw Normal View History

2024-10-17 18:56:13 +00:00
<script lang="ts">
2024-10-17 23:03:50 +00:00
import {PublishStatus} from "@welshman/net"
import {displayRelayUrl} from "@welshman/util"
import Button from "@lib/components/Button.svelte"
2024-10-17 18:56:13 +00:00
2025-02-04 00:37:14 +00:00
interface Props {
url: string
status: string
message: string
retry: () => void
}
let {url, status, message = $bindable(), retry}: Props = $props()
2024-10-17 18:56:13 +00:00
2025-02-04 03:28:29 +00:00
$effect(() => {
2024-10-17 19:29:28 +00:00
if (!message && status === PublishStatus.Timeout) {
message = "request timed out"
}
if (!message) {
message = "no details recieved"
}
2025-02-04 00:37:14 +00:00
})
2024-10-17 18:56:13 +00:00
</script>
2025-11-05 23:32:55 +00:00
<div class="card2 bg-alt col-2 shadow-lg">
2024-10-17 18:56:13 +00:00
<p>
Failed to publish to {displayRelayUrl(url)}: {message}.
</p>
<Button class="link" onclick={retry}>Retry</Button>
2024-10-17 18:56:13 +00:00
</div>