import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { AlignItems, BackgroundColor, BlockSize, Display, FlexDirection, FlexWrap, FontWeight, TextAlign, TextColor, TextVariant, } from '../../../helpers/constants/design-system'; import { Box, Text } from '../../component-library'; export const ActivityListItem = ({ topContent, icon, title, subtitle, midContent, children, rightContent, onClick, className, 'data-testid': dataTestId, }) => { const primaryClassName = classnames('activity-list-item', className, { 'activity-list-item--single-content-row': !(subtitle || children), }); return ( { if (event.key === 'Enter') { onClick(); } }} data-testid={dataTestId} padding={4} display={Display.Flex} width={BlockSize.Full} flexWrap={FlexWrap.Wrap} gap={4} > {topContent && ( {topContent} )} {icon && {icon}} {title} {subtitle && ( {subtitle} )} {children && ( {children} )} {midContent && ( {midContent} )} {rightContent && ( {rightContent} )} ); }; ActivityListItem.propTypes = { topContent: PropTypes.node, icon: PropTypes.node, title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), subtitle: PropTypes.node, midContent: PropTypes.node, children: PropTypes.node, rightContent: PropTypes.node, onClick: PropTypes.func, className: PropTypes.string, 'data-testid': PropTypes.string, };