2020-01-23 10:18:41 +01:00
|
|
|
import { html } from "lit-html";
|
|
|
|
|
2020-09-26 21:07:46 +02:00
|
|
|
const getImgHref = (image, image_type) => {
|
|
|
|
return image.startsWith('data:') ? image : `data:${image_type};base64,${image}`;
|
|
|
|
}
|
|
|
|
|
2020-01-23 10:18:41 +01:00
|
|
|
export default (o) => html`
|
2020-09-26 21:07:46 +02:00
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="avatar ${o.classes}" width="${o.width}" height="${o.height}">
|
|
|
|
<image width="${o.width}" height="${o.height}" preserveAspectRatio="xMidYMid meet" href="${getImgHref(o.image, o.image_type)}"/>
|
2020-05-15 14:33:31 +02:00
|
|
|
</svg>`;
|