ff-webpage/components/base/ListItem.vue

58 lines
1.8 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 h-fit py-2 bg-white shadow-md border border-gray-200 rounded-md justify-start items-start flex"
:class="allowNavigation ? '' : 'pointer-events-none'"
:to="`${urlOverwrite ?? $route.path}/${data?.slug}`"
>
<h1 v-if="numberOverwrite != undefined" class="w-24 text-center text-black text-4xl my-auto">
{{ numberOverwrite }}.
</h1>
<h1 v-else class="w-24 text-center text-black text-4xl my-auto">
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
day: "2-digit",
})
}}.
</h1>
<div class="grow shrink basis-0 flex-col justify-center items-center flex">
<h1 class="w-full">{{ data?.title }}</h1>
2025-01-16 12:50:10 +00:00
<p v-if="numberOverwrite != undefined && data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
2024-11-05 13:41:48 +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
2024-11-05 13:41:48 +00:00
</p>
2025-01-16 12:50:10 +00:00
<p v-else-if="data?.date && data.date.includes('T')" class="w-full text-[#5c5c5c]">
2024-11-05 13:41:48 +00:00
{{
new Date(data?.date ?? "").toLocaleString("de-DE", {
minute: "2-digit",
hour: "2-digit",
})
}}
2025-01-16 12:23:23 +00:00
Uhr
2024-11-05 13:41:48 +00:00
</p>
<p class="w-full text-[#5c5c5c]">
{{ data?.description }}
</p>
</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";
defineProps({
data: Object as PropType<BaseCollection>,
2024-11-05 13:41:48 +00:00
numberOverwrite: { type: Number, default: undefined },
allowNavigation: { type: Boolean, default: false },
urlOverwrite: { type: String, default: undefined },
2024-11-03 14:34:48 +00:00
});
</script>