mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
36 lines
1 KiB
Vue
36 lines
1 KiB
Vue
<script setup lang="ts">
|
|
import { cn } from "@/lib/utils";
|
|
import { reactiveOmit } from "@vueuse/core";
|
|
import { ChevronRight } from "lucide-vue-next";
|
|
import {
|
|
DropdownMenuSubTrigger,
|
|
type DropdownMenuSubTriggerProps,
|
|
useForwardProps,
|
|
} from "reka-ui";
|
|
import type { HTMLAttributes } from "vue";
|
|
|
|
const props = defineProps<
|
|
DropdownMenuSubTriggerProps & {
|
|
class?: HTMLAttributes["class"];
|
|
inset?: boolean;
|
|
}
|
|
>();
|
|
|
|
const delegatedProps = reactiveOmit(props, "class", "inset");
|
|
const forwardedProps = useForwardProps(delegatedProps);
|
|
</script>
|
|
|
|
<template>
|
|
<DropdownMenuSubTrigger
|
|
data-slot="dropdown-menu-sub-trigger"
|
|
v-bind="forwardedProps"
|
|
:class="cn(
|
|
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',
|
|
props.class,
|
|
)"
|
|
>
|
|
<slot />
|
|
<ChevronRight class="ml-auto size-4" />
|
|
</DropdownMenuSubTrigger>
|
|
</template>
|