import { computed, createVNode, Fragment } from "vue";
import { makeButtonProps, Button } from "../button/button.mjs";
import { makeGroupItemProps, useGroupItem } from "../../composables/group/index.mjs";
import { BreadcrumbKey } from "./breadcrumb.mjs";
import { Icon } from "../icon/icon.mjs";
import { genericComponent } from "../../utils/define-component.mjs";
const BreadcrumbItem = genericComponent()({
  name: "VeBreadcrumbItem",
  props: {
    ...makeButtonProps({
      variant: "text"
    }),
    ...makeGroupItemProps()
  },
  setup(props, {
    slots
  }) {
    const {
      id,
      group
    } = useGroupItem(props, BreadcrumbKey);
    const hasNext = computed(() => {
      if (!group.items.value.length)
        return false;
      return group.items.value[group.items.value.length - 1].id !== id;
    });
    return () => {
      var _a, _b, _c, _d, _e, _f;
      return createVNode(Fragment, null, [createVNode("li", {
        "class": ["ve-breadcrumb-item", {
          "ve-breadcrumb-item--has-next": hasNext.value
        }]
      }, [createVNode(Button, props, slots)]), hasNext.value && createVNode("li", {
        "class": "ve-breadcrumb-separator",
        "aria-hidden": "true"
      }, [(_f = (_e = (_a = slots.separator) == null ? void 0 : _a.call(slots)) != null ? _e : (_d = (_b = group.vm) == null ? void 0 : (_c = _b.slots).separator) == null ? void 0 : _d.call(_c)) != null ? _f : createVNode(Icon, {
        "icon": "$separator"
      }, null)])]);
    };
  }
});
export {
  BreadcrumbItem
};
//# sourceMappingURL=breadcrumb-item.mjs.map
