<script lang="ts" setup>
import type { DropdownMixedOption } from "naive-ui/es/dropdown/src/interface";
import type { PropType } from "vue";

defineOptions({ name: "Action" });

const props = defineProps({
  options: {
    type: Array as PropType<DropdownMixedOption[]>,
    default: null,
    required: true,
  },
  select: {
    type: Function as PropType<Function>,
    default: () => {},
  },
  id: {
    type: String,
    default: "",
  },
});
const fun = (key) => {
  props.select(key, props.id);
};
</script>

<template>
  <div :data-id="id">
    <n-dropdown trigger="hover" :options="options" @select="fun">
      <SvgIcon name="more-hor" size="20" />
    </n-dropdown>
  </div>
</template>
