/**
* External dependencies
*/
import clsx from 'clsx';
import { Component } from '@wordpress/element';
import PropTypes from 'prop-types';
import { range } from 'lodash';
class ActivityCardPlaceholder extends Component {
render() {
const { className, hasAction, hasDate, hasSubtitle, lines } =
this.props;
const cardClassName = clsx(
'woocommerce-activity-card is-loading',
className
);
return (
{ hasSubtitle && (
) }
{ hasDate && (
) }
{ range( lines ).map( ( i ) => (
) ) }
{ hasAction && (
) }
);
}
}
ActivityCardPlaceholder.propTypes = {
className: PropTypes.string,
hasAction: PropTypes.bool,
hasDate: PropTypes.bool,
hasSubtitle: PropTypes.bool,
lines: PropTypes.number,
};
ActivityCardPlaceholder.defaultProps = {
hasAction: false,
hasDate: false,
hasSubtitle: false,
lines: 1,
};
export default ActivityCardPlaceholder;