2020-02-21 06:06:50 +13:00
|
|
|
<script>
|
2020-11-19 10:06:12 +13:00
|
|
|
import { getContext } from "svelte"
|
2021-06-26 02:29:24 +12:00
|
|
|
import Placeholder from "./Placeholder.svelte"
|
2020-11-19 10:06:12 +13:00
|
|
|
|
2020-11-20 22:50:10 +13:00
|
|
|
const { styleable } = getContext("sdk")
|
2020-11-25 00:02:10 +13:00
|
|
|
const component = getContext("component")
|
2020-11-19 10:06:12 +13:00
|
|
|
|
2021-06-26 02:29:24 +12:00
|
|
|
export let url
|
2020-02-21 06:06:50 +13:00
|
|
|
</script>
|
|
|
|
|
2021-06-26 02:29:24 +12:00
|
|
|
{#if url}
|
|
|
|
<img src={url} alt={$component.name} use:styleable={$component.styles} />
|
|
|
|
{:else}
|
|
|
|
<div
|
|
|
|
class="placeholder"
|
|
|
|
use:styleable={{ ...$component.styles, empty: true }}
|
|
|
|
>
|
|
|
|
<Placeholder />
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.placeholder {
|
|
|
|
display: grid;
|
|
|
|
place-items: center;
|
|
|
|
height: 75px;
|
|
|
|
width: 150px;
|
|
|
|
}
|
|
|
|
</style>
|