import React from 'react'; import {WidgetItem} from './index'; import {gettext} from 'core/utils'; import {IArticle} from 'superdesk-api'; import {generateTrackByIdentifier} from '../services/SearchService'; interface IProps { canEdit?: boolean; customMonitoringWidget?: boolean; preview: (item: IArticle) => void; select: (item: IArticle) => void; edit: (item: IArticle) => void; customUIMessages?: { empty?: string; }; itemIds: Array | null; itemsById: any | null; loading: boolean; selected?: { _id: string }; } /** * @ngdoc React * @module superdesk.search * @name WidgetItemComponent * @description This component is the list of items from a monitoring widget group. */ export class WidgetItemList extends React.Component { render() { if (this.props.loading || this.props.itemIds == null) { return
; } if (!this.props.itemIds?.length) { return (
{this.props.customUIMessages?.empty ? this.props.customUIMessages.empty : gettext('No items in this stage')}
); } return (
    {this.props.itemIds.map((itemId) => { const item = this.props.itemsById[itemId]; return ( ); })}
); } }