action_link = (
  url,
  req,
  {
    action_name,
    action_label,
    confirm,
    rndid,
    action_style,
    action_size,
    action_icon,
    action_bgcol,
    action_title,
    action_class,
    action_bordercol,
    action_textcol,
    spinner,
    block,
  },
  __ = (s) => s
) => {
  const label = action_label === " " ? "" : __(action_label) || action_name;
  let style =
    action_style === "btn-custom-color"
      ? `background-color: ${action_bgcol || "#000000"};border-color: ${
          action_bordercol || "#000000"
        }; color: ${action_textcol || "#000000"}`
      : null;
  if (url.javascript)
    return a(
      {
        href: "javascript:void(0)",
        onclick: `${spinner ? "spin_action_link(this);" : ""}${url.javascript}`,
        class: [
          action_style === "btn-link"
            ? ""
            : `btn ${action_style || "btn-primary"} ${action_size || ""}`,
          action_class,
        ],
        style,
        title: action_title,
      },
      action_icon && action_icon !== "empty"
        ? i({ class: action_icon }) + (label ? "&nbsp;" : "")
        : false,
      label
    );
  else
    return post_btn(url, label, req.csrfToken(), {
      confirm,
      req,
      icon: action_icon,
      style,
      btnClass: `${action_style || "btn-primary"} ${action_size || ""}`,
      formClass: !block && "d-inline",
    });
}
@param {string} url
@param {object} req
@param {object} opts
@param {string} opts.action_name
@param {string} opts.action_label
@param {*} opts.confirm
@param {*} opts.rndid
@param {string} opts.action_style
@param {number} opts.action_size
@param {*} opts.action_icon
@param {string} opts.action_bgcol
@param {string} opts.action_bordercol
@param {string} opts.action_textcol
@param {*} __
@returns {object}