import { PageListController } from "@queenjs/controllers";

export class ComponentController {
  ListCtrl = new PageListController<any, any>();
  createComp() {
    console.log("createPromotion");
  }
  onMenuClick(menu: string, item: any) {
    console.log("onMenuClick", menu, item);
  }
  onEdit(item: any) {
    const _params = new URLSearchParams(decodeURIComponent(location.search));
    const host = _params.get("host");

    // if (location.host == "www.infish.cn") {
    //   const url = `${location.origin}/projects/queenshowv1/editor.html?host=${host}#/?id=${item._id}&mode=editComp`;
    //   location.href = url;
    //   return;
    // }

    const url = `${location.origin}/editor.html?host=${host}#/?id=${item._id}&mode=editComp`;
    location.href = url;
  }
}
