2022-08-10 17:22:08 -04:00
|
|
|
<script setup lang="ts">
|
2023-12-29 17:34:57 -05:00
|
|
|
const props = withDefaults(defineProps<{ src: string; alt?: string }>(), {
|
|
|
|
alt: "",
|
|
|
|
});
|
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">
|
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>
|