mirror of https://github.com/Budibase/budibase.git
3 changed files with 24 additions and 15 deletions
@ -1,21 +1,29 @@ |
|||||
<script> |
<script> |
||||
import { getContext } from "svelte" |
import { getContext } from "svelte" |
||||
|
import Placeholder from "./Placeholder.svelte" |
||||
|
|
||||
const { styleable } = getContext("sdk") |
const { styleable } = getContext("sdk") |
||||
const component = getContext("component") |
const component = getContext("component") |
||||
|
|
||||
export let className = "" |
export let url |
||||
export let url = "" |
|
||||
export let description = "" |
|
||||
export let height |
|
||||
export let width |
|
||||
</script> |
</script> |
||||
|
|
||||
<img |
{#if url} |
||||
{height} |
<img src={url} alt={$component.name} use:styleable={$component.styles} /> |
||||
{width} |
{:else} |
||||
class={className} |
<div |
||||
src={url} |
class="placeholder" |
||||
alt={description} |
use:styleable={{ ...$component.styles, empty: true }} |
||||
use:styleable={$component.styles} |
> |
||||
/> |
<Placeholder /> |
||||
|
</div> |
||||
|
{/if} |
||||
|
|
||||
|
<style> |
||||
|
.placeholder { |
||||
|
display: grid; |
||||
|
place-items: center; |
||||
|
height: 75px; |
||||
|
width: 150px; |
||||
|
} |
||||
|
</style> |
||||
|
|||||
Loading…
Reference in new issue