designtopack/src/components/notifications/Content.vue

45 lines
1.2 KiB
Vue
Raw Normal View History

2024-12-19 10:32:48 +01:00
<template>
<article
class="notification | bg-white rounded-lg | p-16 | flow"
data-type="content"
2024-12-19 10:37:20 +01:00
@click="
read(notification);
router.push(notification.location.page.uri);
"
2024-12-19 10:32:48 +01:00
title="Aller au contenu"
>
<header>
<p class="flex">
<strong
class="notification__type | font-medium text-primary"
data-icon="content"
>Contenu</strong
>
<span class="notification__client | text-grey-700">{{
notification.location.project.title
}}</span>
<time
datetime=""
class="notification__date | text-grey-700 | ml-auto"
>{{ formatDate(notification) }}</time
>
</p>
</header>
<p
v-if="notification.type"
class="notification__body | text-md font-medium | line-clamp"
>
{{ notification.text }}
</p>
</article>
</template>
<script setup>
import { useRouter } from "vue-router";
import { useNotificationsStore } from "../../stores/notifications";
const router = useRouter();
const { notification } = defineProps({ notification: Object });
const { formatDate, read } = useNotificationsStore();
</script>