2022-09-03 09:17:57 +00:00
|
|
|
<template>
|
|
|
|
<NuxtLink
|
|
|
|
class="group card bg-neutral text-neutral-content hover:bg-primary transition-colors duration-300"
|
|
|
|
:to="`/item/${item.id}`"
|
|
|
|
>
|
|
|
|
<div class="card-body py-4 px-6">
|
|
|
|
<h2 class="card-title">
|
|
|
|
<Icon name="mdi-package-variant" />
|
|
|
|
{{ item.name }}
|
|
|
|
</h2>
|
2022-09-06 18:32:13 +00:00
|
|
|
<p>{{ description }}</p>
|
2022-09-03 09:17:57 +00:00
|
|
|
<div class="flex gap-2 flex-wrap justify-end">
|
2022-09-09 22:46:53 +00:00
|
|
|
<LabelChip
|
|
|
|
v-for="label in item.labels"
|
|
|
|
:key="label.id"
|
|
|
|
:label="label"
|
|
|
|
class="badge-primary group-hover:badge-secondary"
|
|
|
|
/>
|
2022-09-03 09:17:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</NuxtLink>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-09-12 22:47:27 +00:00
|
|
|
import { ItemOut, ItemSummary } from "~~/lib/api/types/data-contracts";
|
2022-09-24 19:33:38 +00:00
|
|
|
import { truncate } from "~~/lib/strings";
|
2022-09-03 09:17:57 +00:00
|
|
|
|
2022-09-06 18:32:13 +00:00
|
|
|
const props = defineProps({
|
2022-09-03 09:17:57 +00:00
|
|
|
item: {
|
2022-09-12 22:47:27 +00:00
|
|
|
type: Object as () => ItemOut | ItemSummary,
|
2022-09-03 09:17:57 +00:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
});
|
2022-09-06 18:32:13 +00:00
|
|
|
const description = computed(() => {
|
|
|
|
return truncate(props.item.description, 80);
|
|
|
|
});
|
2022-09-03 09:17:57 +00:00
|
|
|
</script>
|