"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useLinkable = useLinkable;
var _vue = require("vue");
var _useInkline = require("@inkline/inkline/composables/useInkline");
function useLinkable(props) {
  const inkline = (0, _useInkline.useInkline)();
  const isLink = (0, _vue.computed)(() => {
    return props.to.value || props.href.value;
  });
  const tag = (0, _vue.computed)(() => {
    const routerComponent = inkline?.options?.routerComponent;
    if (props.to.value && routerComponent) {
      return typeof routerComponent === "string" ? (0, _vue.resolveComponent)(routerComponent) : routerComponent;
    } else if (props.href.value) {
      return "a";
    } else {
      return props.tag.value;
    }
  });
  return {
    tag,
    isLink
  };
}