<script lang="ts">
	// Accept props and ensure onclick matches the expected event handler signature
	const {
		href = undefined as string | undefined,
		onclick = undefined as
			| ((event: MouseEvent & { currentTarget: EventTarget & HTMLButtonElement }) => void)
			| undefined,
		disabled = false,
		children
	} = $props();
</script>

{#if href}
	<a class="btn" {href}>{@render children?.()}</a>
{:else}
	<button class="btn" {onclick} {disabled}>{@render children?.()}</button>
{/if}
