Skip to content

Commit

Permalink
use basic table
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Mar 24, 2023
1 parent 60ad884 commit d394a9d
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiBadge,
EuiCallOut,
EuiInMemoryTable,
EuiBasicTable,
EuiSearchBar,
EuiSpacer,
IconColor,
Expand Down Expand Up @@ -294,6 +294,12 @@ export const NotificationsList: FC = () => {

const newNotificationsCount = Object.values(notificationsCounts).reduce((a, b) => a + b);

const itemsPerPage = useMemo(() => {
const fromIndex = pagination.pageIndex * pagination.pageSize;
const toIndex = fromIndex + pagination.pageSize;
return items.slice(fromIndex, toIndex);
}, [items, pagination]);

return (
<>
<SavedObjectsWarning onCloseFlyout={fetchNotifications} forceRefresh={isLoading} />
Expand Down Expand Up @@ -382,12 +388,12 @@ export const NotificationsList: FC = () => {
</>
) : null}

<EuiInMemoryTable<NotificationItem>
<EuiBasicTable<NotificationItem>
columns={columns}
hasActions={false}
isExpandable={false}
isSelectable={false}
items={items}
items={itemsPerPage}
itemId={'id'}
loading={isLoading}
rowProps={(item) => ({
Expand All @@ -397,7 +403,7 @@ export const NotificationsList: FC = () => {
onChange={onTableChange}
sorting={sorting}
data-test-subj={isLoading ? 'mlNotificationsTable loading' : 'mlNotificationsTable loaded'}
message={
noItemsMessage={
<FormattedMessage
id="xpack.ml.notifications.noItemsFoundMessage"
defaultMessage="No notifications found"
Expand Down

0 comments on commit d394a9d

Please sign in to comment.