// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import React, { Component } from 'react'; import PropTypes from 'prop-types'; import {Card, CardTitle, CardSubtitle, CardText, CardBody, CardImg } from 'reactstrap'; import './CardItem.scss'; export class CardItem extends Component { render() { const {children, title, subtitle, imageUrl, footer, onClick, className, ...rest} = this.props; let cardClassName = 'spd-carditem'; if(onClick){ cardClassName += ' spd-carditem__clickable'; } if(className){ cardClassName += ` ${className}`; } return ( { imageUrl && } { title && {title} } { subtitle && {subtitle} } {children} {footer && {footer} } ); } } CardItem.propTypes = { title : PropTypes.string, subtitle : PropTypes.string, imageUrl : PropTypes.string, footer : PropTypes.string, onClick : PropTypes.func };