~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0
58 lines · 1.4 KB Raw History
<script lang="ts">
	// A call that failed: what went wrong, in the words it came with, and a
	// way to try again where there is one.
	let {
		message,
		title = 'Something went wrong',
		onretry
	}: { message: string; title?: string; onretry?: () => void } = $props();
</script>

<div class="error" role="alert">
	<p class="title">{title}</p>
	<p class="message">{message}</p>
	{#if onretry}
		<button type="button" onclick={onretry}>Try again</button>
	{/if}
</div>

<style>
	p {
		margin: 0;
	}

	.error {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: var(--hud-space-1);
		padding: var(--hud-space-3) var(--hud-space-4);
		border: var(--border-width-regular) solid var(--color-border-danger);
		border-radius: var(--border-radius-md);
		background: var(--color-background-danger);
		color: var(--color-text-primary);
		font-size: var(--font-text-sm-size);
		line-height: var(--font-text-sm-line-height);
	}

	.title {
		color: var(--color-text-danger);
		font-weight: var(--font-weight-semibold);
	}

	.message {
		overflow-wrap: anywhere;
		white-space: pre-wrap;
	}

	button {
		margin-top: var(--hud-space-2);
		padding: var(--hud-space-1) var(--hud-space-3);
		border: var(--border-width-regular) solid var(--color-border-primary);
		border-radius: var(--border-radius-sm);
		background: var(--color-background-primary);
		color: var(--color-text-primary);
		font: inherit;
		cursor: pointer;
	}
</style>