import { getScheduleColors, getUsableSchedules } from "../../utils.js";
import React from "react";
import { Popover } from "antd";
import { locales } from "@pisell/utils";
import AlertCircle from "@pisell/icon/es/AlertCircle";
import "./index.less";
//#region src/components/schedules/products/list/ProductItem/index.tsx
const ProductItem = ({ item, onClickItem, layout = "all" }) => {
	return /* @__PURE__ */ React.createElement("div", {
		className: "pisell-lowcode__schedules-component-products-item",
		key: item.id,
		onClick: () => {
			onClickItem(item);
		}
	}, /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__schedules-component-products-item-left" }, layout === "day" ? /* @__PURE__ */ React.createElement("div", {
		className: "tag",
		style: { background: getScheduleColors(item["schedules"]) }
	}) : null, /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__schedules-component-products-item-title" }, item.title)), /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__schedules-component-products-item-right" }, layout === "day" ? /* @__PURE__ */ React.createElement("div", { className: "hours" }, item._schedules.str) : null, layout === "day" || getUsableSchedules(item._schedules) ? null : /* @__PURE__ */ React.createElement(Popover, { content: locales.getText("pisell2.text.products.no-current-schedule") }, /* @__PURE__ */ React.createElement(AlertCircle, { className: "pisell-lowcode__schedules-component-products-item-icon" }))));
};
//#endregion
export { ProductItem as default };
