import { useState } from 'react'; import { Alert, Card, CardBody, CardHeader, Divider, Flex, FlexItem, Grid, GridItem, Label, LabelStatus, NotificationDrawer, NotificationDrawerBody, NotificationDrawerGroup, NotificationDrawerList, NotificationDrawerListItem, NotificationDrawerListItemBody, NotificationDrawerListItemHeader, Popover, Title, Icon } from '@patternfly/react-core'; import { Table, Thead, Tbody, Tr, Th, Td, ExpandableRowContent } from '@patternfly/react-table'; import RhUiCheckCircleFillIcon from '@patternfly/react-icons/dist/js/icons/rh-ui-check-circle-fill-icon'; import RhUiErrorFillIcon from '@patternfly/react-icons/dist/js/icons/rh-ui-error-fill-icon'; import t_global_text_color_subtle from '@patternfly/react-tokens/dist/esm/t_global_text_color_subtle'; export const CardStatus: React.FunctionComponent = () => { const [drawerExpanded, setDrawerExpanded] = useState(false); const handleDrawerToggleClick = () => { setDrawerExpanded(!drawerExpanded); }; const [rowsExpanded, setRowsExpanded] = useState([false, false, false]); const handleToggleExpand = (_: any, rowIndex: number) => { const newRowsExpanded = [...rowsExpanded]; newRowsExpanded[rowIndex] = !rowsExpanded[rowIndex]; setRowsExpanded(newRowsExpanded); }; const header = ( Status ); const columns = ['Components', 'Response Rate']; const rows = [ { content: ['API Servers', '20%'], child: ( ) }, { content: ['Controller Managers', '100%'], child: ( ) }, { content: ['etcd', '91%'], child: ( ) } ]; const popoverBodyContent = ( <>
Components of the Control Panel are responsible for maintaining and reconciling the state of the cluster.
))} {rows.map((row, rowIndex) => { const parentRow = ( ))} ); const childRow = row.child ? ( ) : null; return ( {parentRow} {childRow} ); })}
{columns.map((column, columnIndex) => ( {column}
{row.content.map((cell, cellIndex) => ( {cell}
{row.child}
); const body = ( Cluster e.preventDefault()}> Control Panel Operators 1 degraded Image Vulnerabilities 0 vulnerabilities ); const drawerTitle = ( Notifications ); const drawer = ( This is a long description to show how the title will wrap if it is long and wraps to multiple lines. This is a warning notification description. ); return ( {header} {body} {drawer} ); };