1
0
Fork 0
mirror of https://github.com/CorentinTh/it-tools.git synced 2025-07-26 08:39:38 +02:00
it-tools/packages/app/src/modules/ui/components/dropdown-menu/DropdownMenuLabel.vue

25 lines
705 B
Vue
Raw Normal View History

2024-10-24 21:05:54 +02:00
<script setup lang="ts">
2024-10-27 15:02:54 +01:00
import { cn } from '@/src/modules/shared/style/cn';
import { DropdownMenuLabel, type DropdownMenuLabelProps, useForwardProps } from 'radix-vue';
import { computed, type HTMLAttributes } from 'vue';
2024-10-24 21:05:54 +02:00
2024-10-27 15:02:54 +01:00
const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes['class']; inset?: boolean }>();
2024-10-24 21:05:54 +02:00
const delegatedProps = computed(() => {
2024-10-27 15:02:54 +01:00
const { class: _, ...delegated } = props;
2024-10-24 21:05:54 +02:00
2024-10-27 15:02:54 +01:00
return delegated;
});
2024-10-24 21:05:54 +02:00
2024-10-27 15:02:54 +01:00
const forwardedProps = useForwardProps(delegatedProps);
2024-10-24 21:05:54 +02:00
</script>
<template>
<DropdownMenuLabel
v-bind="forwardedProps"
:class="cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', props.class)"
>
<slot />
</DropdownMenuLabel>
</template>