import $ from "jquery";

import { CrossSellingPointer } from "../../others/crossSellingPointer.js";
import { RCL } from "../names.js";

/**
 * Add new category in Products > Categories / Attributes
 */
const crossRclAddWcCategory = () =>
    $("select#parent").length && // only hierarchical taxonomies
    CrossSellingPointer.isActionAvailable(RCL, "add-wc-category") &&
    $("body.wp-admin.edit-tags-php.woocommerce-page form#addtag #submit").one("click", function () {
        new CrossSellingPointer($(this), RCL, "add-wc-category", "bottom");
    });

export { crossRclAddWcCategory };
