mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
32 lines
983 B
Vue
32 lines
983 B
Vue
<script setup lang="ts">
|
|
import { cn } from "@/lib/utils";
|
|
import {
|
|
DropdownMenuItem,
|
|
type DropdownMenuItemProps,
|
|
useForwardProps,
|
|
} from "radix-vue";
|
|
import { type HTMLAttributes, computed } from "vue";
|
|
|
|
const props = defineProps<
|
|
DropdownMenuItemProps & { class?: HTMLAttributes["class"]; inset?: boolean }
|
|
>();
|
|
|
|
const delegatedProps = computed(() => {
|
|
const { class: _, ...delegated } = props;
|
|
|
|
return delegated;
|
|
});
|
|
|
|
const forwardedProps = useForwardProps(delegatedProps);
|
|
</script>
|
|
|
|
<template>
|
|
<DropdownMenuItem v-bind="forwardedProps" :class="cn(
|
|
'relative flex cursor-default select-none items-center rounded-sm gap-2 px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:mr-0.5 w-full',
|
|
inset && 'pl-8',
|
|
props.class,
|
|
)">
|
|
<slot />
|
|
</DropdownMenuItem>
|
|
</template>
|