<script lang="ts">
	import { generateSizesString, generateSrcsetString } from '$lib/content/srcset';

	import Hero from '@damillora/plachta/components/Hero/Hero.svelte';

	export let background: string | null = null;
	export let alt = '';
	let srcset: string | null = null;
	let sizes: string | null = null;
	$: if (background != null) {
		srcset = generateSrcsetString(background);
		sizes = '100vw';
	} else {
		srcset = null;
		sizes = null;
	}
</script>

{#if background}
	<Hero {background} {alt} {srcset} {sizes} />
{:else}
	<Hero background="/images/default-feature.jpg" {alt} />
{/if}
