Sha256: e63b3b2840c56d36b15fa7d36fce044111fa5ee70b115a27f138b27e2ef3ac66
Contents?: true
Size: 1.51 KB
Versions: 83
Compression:
Stored size: 1.51 KB
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { Card } from 'patternfly-react'; import classNames from 'classnames'; import { noop } from 'foremanReact/common/helpers'; import { translate as __ } from 'foremanReact/common/I18n'; import { TASKS_DASHBOARD_AVAILABLE_QUERY_STATES } from '../../../../TasksDashboardConstants'; import { queryPropType } from '../../../../TasksDashboardPropTypes'; import './ScheduledTasksCard.scss'; const ScheduledTasksCard = ({ data, className, query, updateQuery, ...props }) => { const { SCHEDULED } = TASKS_DASHBOARD_AVAILABLE_QUERY_STATES; const onClick = () => updateQuery({ state: SCHEDULED }); return ( <Card className={classNames( 'tasks-donut-card', 'scheduled-tasks-card', className, { 'selected-tasks-card': query.state === SCHEDULED, 'not-focused': query.state && query.state !== SCHEDULED, } )} {...props} id="scheduled-tasks-card" > <Card.Title onClick={onClick}>{__('Scheduled')}</Card.Title> <Card.Body> <div className="scheduled-data" onClick={onClick}> {data} <p>{__('Total')}</p> </div> </Card.Body> </Card> ); }; ScheduledTasksCard.propTypes = { data: PropTypes.number, query: queryPropType, className: PropTypes.string, updateQuery: PropTypes.func, }; ScheduledTasksCard.defaultProps = { data: 0, query: {}, className: '', updateQuery: noop, }; export default ScheduledTasksCard;
Version data entries
83 entries across 83 versions & 1 rubygems