/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ import React, { Component } from "react"; import { EuiFlexGrid, EuiSpacer, EuiFlexItem, EuiText } from "@elastic/eui"; import { ContentPanel, ContentPanelActions } from "../../../../components/ContentPanel"; import { ModalConsumer } from "../../../../components/Modal"; interface GeneralInformationProps { rollupId: string; description: string; sourceIndex: string; targetIndex: string; scheduleText: string; pageSize: number; lastUpdated: string; onEdit: () => void; } export default class GeneralInformation extends Component { constructor(props: GeneralInformationProps) { super(props); } render() { const { rollupId, description, onEdit, sourceIndex, targetIndex, scheduleText, pageSize, lastUpdated } = this.props; const infoItems = [ { term: "Name", value: rollupId }, { term: "Source index", value: sourceIndex }, { term: "Target index", value: targetIndex }, { term: "Schedule", value: scheduleText }, { term: "Description", value: description || "-" }, { term: "Last updated", value: lastUpdated }, { term: "Pages per execution", value: pageSize }, ]; return ( {() => ( onEdit(), }, }, ]} /> )} } bodyStyles={{ padding: "initial" }} title="General information" titleSize="m" >
{infoItems.map((item) => (
{item.term}
{item.value}
))}
); } }