<script lang="ts">
    import { getAssetUrl } from '$utils/helpers'

    export let id: string
    export let alt: string
    export let width: number
    export let height: number
    export let quality: number = 90
    export let sizes: any = {}
    export let fit: string = 'inside'
    export let format: string = 'jpg'
    export let lazy: boolean = true

    // TODO:
    // - sizes
    // -- width
    // -- height
</script>

<picture class={$$props.class}>
    <img
        src={getAssetUrl(id, width, height, quality, fit, format)}
        width={width}
        height={height}
        alt={alt}
        loading={lazy ? 'lazy' : undefined}
    />
</picture>