import { defineComponent as l, resolveComponent as m, openBlock as c, createBlock as d, h as g } from "vue";
import { useI18n as p } from "@feedmepos/mf-common";
import { components as u } from "@feedmepos/ui-library";
import { F as r } from "./app-Bpb4394e.js";
const w = /* @__PURE__ */ l({
  __name: "InventoryBindingSummary",
  props: {
    rowData: {}
  },
  emits: ["row-click"],
  setup(f, { emit: t }) {
    const a = t, { t: n } = p(), s = [
      {
        id: "name",
        accessorKey: "name",
        size: "auto",
        header: () => n("inventory.inventoryBindings.name"),
        enableSorting: !1
      },
      {
        id: "ingredient",
        maxSize: 200,
        header: () => n("inventory.inventoryBindings.ingredient"),
        cell(e) {
          const o = e.row.original.binding.filter(
            (i) => i.type === r.enum.SKU
          ).length;
          return n("inventory.inventoryBindings.itemsLinked", { count: o });
        },
        enableSorting: !1
      },
      {
        id: "recipe",
        maxSize: 200,
        header: () => n("inventory.inventoryBindings.recipe"),
        cell(e) {
          const o = e.row.original.binding.filter(
            (i) => i.type === r.enum.RECIPE
          ).length;
          return n("inventory.inventoryBindings.itemsLinked", { count: o });
        },
        enableSorting: !1
      },
      {
        id: "action",
        header: "",
        size: 0,
        cell(e) {
          return g(u.FmButton, {
            icon: "edit",
            iconColor: "neutral-gray-400",
            bgColor: "transparent",
            size: "md",
            onClick() {
              a("row-click", e.row.original);
            }
          });
        },
        enableSorting: !1
      }
    ];
    return (e, o) => {
      const i = m("FmTable");
      return c(), d(i, {
        "row-data": e.rowData,
        "column-defs": s,
        "hide-footer": "",
        "shrink-at": 9999,
        "page-size": e.rowData.length
      }, null, 8, ["row-data", "page-size"]);
    };
  }
});
export {
  w as default
};
