import { extend, mergeData } from '../../vue';
import { NAME_DROPDOWN_DIVIDER } from '../../constants/components';
import { PROP_TYPE_STRING } from '../../constants/props';
import { makePropsConfigurable, makeProp } from '../../utils/props';
import { omit } from '../../utils/object';

// --- Props ---

const props = makePropsConfigurable({
  tag: makeProp(PROP_TYPE_STRING, 'hr')
}, NAME_DROPDOWN_DIVIDER);

// --- Main component ---

// @vue/component
const BDropdownDivider = /*#__PURE__*/extend({
  name: NAME_DROPDOWN_DIVIDER,
  functional: true,
  props,
  render(h, _ref) {
    let {
      props,
      data
    } = _ref;
    return h('li', mergeData(omit(data, ['attrs']), {
      attrs: {
        role: 'presentation'
      }
    }), [h(props.tag, {
      staticClass: 'dropdown-divider',
      attrs: {
        ...(data.attrs || {}),
        role: 'separator',
        'aria-orientation': 'horizontal'
      },
      ref: 'divider'
    })]);
  }
});

export { BDropdownDivider, props };
