2022-08-10 17:22:08 -04:00
|
|
|
<script setup lang="ts">
|
2024-10-16 13:25:13 -04:00
|
|
|
const { src, alt = "" } = defineProps<{ src: string; alt?: string }>();
|
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">
|
2023-12-29 17:34:57 -05:00
|
|
|
<img :src="imgSrc" class="drop-shadow-lg" :alt="alt" />
|
|
|
|
<figcaption class="text-center" v-if="alt">{{ alt }}</figcaption>
|
2022-08-10 17:22:08 -04:00
|
|
|
</figure>
|
|
|
|
</template>
|