<template>
  <div class="popover-menu-item" :class="[center && 'center', active && 'active']" @click="emit('click')">
    <slot></slot>
  </div>
</template>

<script lang="ts" setup>
withDefaults(
  defineProps<{
    center?: boolean
    active?: 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,
  &.active {
    background: #f5f6fa;
  }
  & + .popover-menu-item {
    margin-top: 8px;
  }
}
</style>
