/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { PieChart, Container, Header, Box} from '@awsui/components-react'; // Attribute Display message content const WaveStatus = ({data, children}) => { let statusType = 'loading'; let waveStatus = data.data.map(function(value, index) {return value['wave_status']}); let wave_count = []; waveStatus.forEach(function(value, index) { let lvalue = value; if (lvalue === undefined){ lvalue = 'No Status' } let item = wave_count.filter(function (entry) { return entry.title === lvalue; }); if (item.length === 1) { item[0].value += 1; } else { wave_count.push({title: lvalue, value: 1}); } }); if (!data.isLoading && !data.error) { statusType = 'finished'; } else if (!data.isLoading && data.error) { statusType = 'error'; } return Wave status } > `${datum.value} waves, ${( (datum.value / sum) * 100 ).toFixed(0)}%` } i18nStrings={{ detailsValue: "Value", detailsPercentage: "Percentage", filterLabel: "Filter displayed data", filterPlaceholder: "Filter data", filterSelectedAriaLabel: "selected", detailPopoverDismissAriaLabel: "Dismiss", legendAriaLabel: "Legend", chartAriaRoleDescription: "pie chart", segmentAriaRoleDescription: "segment" }} empty={ No data available There is no data available } noMatch={ No matching data There is no matching data to display } /> }; export default WaveStatus;