import * as React from 'react';
import classnames from 'classnames';
import {FlexBlock} from '../flexBlock';

type CardTitleProps = {
    center?: boolean;
    addTopOffset?: boolean;
    addBottomOffset?: boolean;
};

export class CardContent extends React.PureComponent<CardTitleProps> {
    render() {
        const {center, addTopOffset, addBottomOffset, children} = this.props;

        const className = classnames('rc-card__content', {
            'rc-card__content--center': center,
            'rc-card__content--bottom-offset': addBottomOffset,
            'rc-card__content--top-offset': addTopOffset
        });

        return (
            <FlexBlock
                className={className}
                justify={center ? FlexBlock.CENTER : undefined}
                gutterWidth={0}>
                <div>{children}</div>
            </FlexBlock>
        );
    }
}
