<script>
	let { src, fallback = '/images/default_cover.jpg', class: className = '' } = $props();

	/** @param {Event} e */
	function handleError(e) {
		const img = /** @type {HTMLImageElement} */ (e.currentTarget);
		img.src = fallback;
	}
</script>

<img {src} onerror={handleError} class={className} alt="book cover" />
