ff-webpage/components/base/ListImageItem.vue

62 lines
1.9 KiB
Vue
Raw Normal View History

2024-11-03 14:34:48 +00:00
<template>
2024-11-05 13:41:48 +00:00
<NuxtLink
class="w-full sm:w-72 h-96 rounded-lg shadow-md border border-gray-200 flex-col justify-start items-start inline-flex overflow-hidden"
:class="allowNavigation ? '' : 'pointer-events-none'"
:to="`${urlOverwrite ?? $route.path}/${data?.slug}`"
>
<NuxtPicture
loading="lazy"
class="w-full h-56 object-cover object-center"
:src="baseUrl + data?.image?.url"
:imgAttrs="{ class: 'w-full h-56 object-cover object-center' }"
/>
2024-11-06 07:59:07 +00:00
<div class="w-full h-44 relative bg-white px-2 py-5 flex flex-col justify-start items-start gap-2 overflow-y-auto">
2025-01-16 12:23:23 +00:00
<h1>
<span v-if="numberOverwrite != undefined" class="w-24 text-center text-black text-4xl my-auto">
{{ numberOverwrite }}.
</span>
{{ data?.title }}
</h1>
<p v-if="numberOverwrite != undefined" class="w-full text-[#5c5c5c]">
2024-11-06 07:59:07 +00:00
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
month: "long",
year: "numeric",
minute: "2-digit",
hour: "2-digit",
})
}}
2025-01-16 12:23:23 +00:00
Uhr
</p>
<p v-else class="w-full text-[#5c5c5c]">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit",
hour: "2-digit",
})
}}
Uhr
2024-11-06 07:59:07 +00:00
</p>
<p class="w-full text-[#5c5c5c]">
{{ data?.description }}
</p>
2024-11-05 13:41:48 +00:00
</div>
</NuxtLink>
2024-11-03 14:34:48 +00:00
</template>
<script setup lang="ts">
import type { PropType } from "vue";
import type BaseCollection from "~/types/collection/baseCollection";
2024-11-05 17:31:12 +00:00
const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;
2024-11-05 13:41:48 +00:00
2024-11-03 14:34:48 +00:00
defineProps({
data: Object as PropType<BaseCollection>,
2025-01-16 12:23:23 +00:00
numberOverwrite: { type: Number, default: undefined },
2024-11-05 13:41:48 +00:00
allowNavigation: { type: Boolean, default: false },
urlOverwrite: { type: String, default: undefined },
2024-11-03 14:34:48 +00:00
});
</script>