<template>
  <div class="popover-menu-item" :class="{ center: center }" @click="emit('click')">
    <slot></slot>
  </div>
</template>

<script lang="ts" setup>
withDefaults(
  defineProps<{
    center?: boolean
  }>(),
  {
    center: false
  }
)

const emit = defineEmits<{
  (event: "click"): void
}>()
</script>

<style lang="scss" scoped>
.popover-menu-item {
  min-width: 80px;
  padding: 8px 24px;
  cursor: pointer;
  border-radius: 4px;

  &.center {
    text-align: center;
  }
  &:hover {
    background: #f5f6fa;
  }
  & + .popover-menu-item {
    margin-top: 8px;
  }
}
</style>
