"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.ShardFailureTable = ShardFailureTable; var _react = _interopRequireDefault(require("react")); var _i18n = require("@kbn/i18n"); var _react2 = require("@emotion/react"); var _eui = require("@elastic/eui"); var _shard_failure_description = require("./shard_failure_description"); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0 and the Server Side Public License, v 1; you may not use this file except * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ const SORTING = { sort: { field: 'index', direction: 'desc' } }; function ShardFailureTable({ failures }) { const itemList = failures.map((failure, idx) => ({ ...{ id: String(idx) }, ...failure })); const columns = [{ name: _i18n.i18n.translate('data.search.searchSource.fetch.shardsFailedModal.tableColReason', { defaultMessage: 'Reason' }), render: item => { return /*#__PURE__*/_react.default.createElement(_shard_failure_description.ShardFailureDescription, item); }, mobileOptions: { header: false } }]; return /*#__PURE__*/_react.default.createElement(_eui.EuiInMemoryTable, { itemId: "id", items: itemList, columns: columns, pagination: itemList.length > 10, sorting: SORTING, css: (0, _react2.css)` & .euiTableHeaderCell { ${(0, _eui.euiScreenReaderOnly)()} } & .euiTableRowCell { border-top: none; } ` }); }