import BaseButton from '@elements/BaseButton/index.vue';
import validatorPropsObject from '@assets/js/validator-props-object.js';

export default {
  name: 'BaseDropdown',
  components: {
    BaseButton,
  },
  data() {
    return {
      active: false,
    };
  },
  props: {
    items: {
      type: Array,
      required: true,
      validator: values =>
        validatorPropsObject({
          values,
          keys: ['title', 'href', 'click', 'bottomLine', 'topLine'],
        }),
    },
  },
  methods: {
    onClick(clickedItem) {
      this.$emit(clickedItem);
      this.active = false;
    },
  },
};
