import React from "react";
import { Skeleton, Popover } from "antd";
import "./index.less";
import { locales } from "@pisell/utils";
var ResourceList = function ResourceList(props) {
  var dataSource = props.dataSource,
    loading = props.loading,
    onClick = props.onClick;
  var goResourceItem = function goResourceItem(item) {
    onClick === null || onClick === void 0 || onClick(item);
  };
  return /*#__PURE__*/React.createElement(Skeleton, {
    active: true,
    round: true,
    loading: loading
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-lowcode__resource-list"
  }, dataSource.map(function (item) {
    return /*#__PURE__*/React.createElement("div", {
      className: "pisell-lowcode__resource-list-item",
      key: item.id,
      onClick: function onClick() {
        goResourceItem(item);
      }
    }, /*#__PURE__*/React.createElement(Popover, {
      content: locales.getText("pisell2.text.products.edit-resource-message")
    }, /*#__PURE__*/React.createElement("span", {
      className: "pisell-lowcode__resource-list-item-title"
    }, item.title)));
  })));
};
export default ResourceList;