2022-01-16 15:24:24 -09:00
|
|
|
<template>
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-chip
|
|
|
|
v-bind="$attrs"
|
|
|
|
label
|
|
|
|
variant="flat"
|
|
|
|
:color="label.color || undefined"
|
|
|
|
:text-color="textColor"
|
|
|
|
>
|
2023-02-26 13:12:53 -06:00
|
|
|
<span style="max-width: 100%; overflow: hidden; text-overflow: ellipsis;">
|
|
|
|
{{ label.name }}
|
|
|
|
</span>
|
2022-01-16 15:24:24 -09:00
|
|
|
</v-chip>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2024-10-01 10:47:51 -05:00
|
|
|
import { getTextColor } from "~/composables/use-text-color";
|
2025-06-20 00:09:12 +07:00
|
|
|
import type { MultiPurposeLabelSummary } from "~/lib/api/types/recipe";
|
2022-01-16 15:24:24 -09:00
|
|
|
|
2025-06-20 00:09:12 +07:00
|
|
|
export default defineNuxtComponent({
|
2022-01-16 15:24:24 -09:00
|
|
|
props: {
|
|
|
|
label: {
|
|
|
|
type: Object as () => MultiPurposeLabelSummary,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setup(props) {
|
2024-10-01 10:47:51 -05:00
|
|
|
const textColor = computed(() => getTextColor(props.label.color));
|
2022-01-16 15:24:24 -09:00
|
|
|
|
|
|
|
return {
|
|
|
|
textColor,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2022-03-19 11:31:17 -08:00
|
|
|
</script>
|