2022-08-10 17:22:08 -04:00
|
|
|
<script setup lang="ts">
|
2023-01-28 15:32:48 -05:00
|
|
|
const props = defineProps<{ src: string }>();
|
2022-08-10 18:05:40 -04:00
|
|
|
|
2023-01-28 15:32:48 -05:00
|
|
|
const src = props.src;
|
2022-08-10 18:05:40 -04:00
|
|
|
const imgSrc =
|
|
|
|
src.startsWith("http://") || src.startsWith("https://")
|
|
|
|
? src
|
|
|
|
: `/images/posts/${src}`;
|
2022-08-10 17:22:08 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-08-10 18:05:40 -04:00
|
|
|
<figure class="flex flex-col items-center">
|
|
|
|
<img :src="imgSrc" />
|
2022-10-02 16:30:35 -04:00
|
|
|
<figcaption class="text-center"><slot /></figcaption>
|
2022-08-10 17:22:08 -04:00
|
|
|
</figure>
|
|
|
|
</template>
|