Link = ({
  text,
  block,
  isFormula,
  textStyle,
  link_style,
  link_size,
  link_icon,
  link_bgcol,
  link_bordercol,
  link_textcol,
}) => {
  const {
    selected,
    connectors: { connect, drag },
  } = useNode((node) => ({ selected: node.events.selected }));
  if (!link_style)
    return (
      <span
        className={`${textStyle} is-builder-link ${
          selected ? "selected-node" : ""
        } ${isFormula?.text ? "font-monospace" : ""} ${block ? "d-block" : ""}`}
        ref={(dom) => connect(drag(dom))}
      >
        <DynamicFontAwesomeIcon icon={link_icon} className="me-1" />
        {isFormula?.text ? `=${text}` : text}
      </span>
    );
  else
    return (
      <button
        className={`${textStyle} is-builder-link ${
          selected ? "selected-node" : ""
        } ${isFormula?.text ? "font-monospace" : ""} ${link_style} ${
          link_size || ""
        } ${block ? "d-block" : ""}`}
        ref={(dom) => connect(drag(dom))}
        style={
          link_style === "btn btn-custom-color"
            ? {
                backgroundColor: link_bgcol || "#000000",
                borderColor: link_bordercol || "#000000",
                color: link_textcol || "#000000",
              }
            : {}
        }
      >
        <DynamicFontAwesomeIcon icon={link_icon} className="me-1" />
        {isFormula?.text ? `=${text}` : text}
      </button>
    );
}
@param {object} props
@param {string} props.text
@param {boolean} props.block
@param {object} props.isFormula
@param {string} props.textStyle
@param {string} props.link_style
@param {string} props.link_size
@param {string} [props.link_icon]
@param {string} [props.link_bgcol]
@param {string} [props.link_bordercol]
@param {string} [props.link_textcol]
@returns {Fragment}
@namespace
@category saltcorn-builder
@subcategory components