2020-02-20 18:06:50 +01:00
|
|
|
<script>
|
2020-11-18 22:06:12 +01:00
|
|
|
import { getContext } from "svelte"
|
2021-06-25 16:29:24 +02:00
|
|
|
import Placeholder from "./Placeholder.svelte"
|
2020-11-18 22:06:12 +01:00
|
|
|
|
2020-11-20 10:50:10 +01:00
|
|
|
const { styleable } = getContext("sdk")
|
2020-11-24 12:02:10 +01:00
|
|
|
const component = getContext("component")
|
2020-11-18 22:06:12 +01:00
|
|
|
|
2021-06-25 16:29:24 +02:00
|
|
|
export let url
|
2020-02-20 18:06:50 +01:00
|
|
|
</script>
|
|
|
|
|
2021-06-25 16:29:24 +02: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>
|