/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React, { Component } from "react"; import { EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiPagination } from "@elastic/eui"; interface PolicyControlsProps { activePage: number; pageCount: number; search: string; onSearchChange: (e: React.ChangeEvent) => void; onPageClick: (page: number) => void; onRefresh: () => Promise; } interface PolicyControlsState { refreshInterval: number; isPaused: boolean; } export default class PolicyControls extends Component { state: PolicyControlsState = { refreshInterval: 0, isPaused: true, }; onRefreshChange = ({ refreshInterval, isPaused }: PolicyControlsState): void => { this.setState({ isPaused, refreshInterval }); }; render() { const { activePage, pageCount, search, onSearchChange, onPageClick } = this.props; return ( {pageCount > 1 && ( )} ); } }