import { computed, resolveComponent } from "vue";
import { useInkline } from "@inkline/inkline/composables/useInkline";
export function useLinkable(props) {
  const inkline = useInkline();
  const isLink = computed(() => {
    return props.to.value || props.href.value;
  });
  const tag = computed(() => {
    const routerComponent = inkline?.options?.routerComponent;
    if (props.to.value && routerComponent) {
      return typeof routerComponent === "string" ? resolveComponent(routerComponent) : routerComponent;
    } else if (props.href.value) {
      return "a";
    } else {
      return props.tag.value;
    }
  });
  return { tag, isLink };
}
