2020-10-23 06:41:45 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2021-01-07 23:57:09 +00:00
|
|
|
import { Card as WPCard, CardBody, CardHeader } from '@wordpress/components';
|
2020-10-23 06:41:45 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2021-01-07 23:57:09 +00:00
|
|
|
import { Text } from '@woocommerce/experimental';
|
2020-10-23 06:41:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
|
|
|
|
|
|
|
const Card = ( props ) => {
|
|
|
|
const { title, description, children, className } = props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<WPCard
|
2024-05-31 03:49:36 +00:00
|
|
|
className={ clsx( className, 'woocommerce-admin-marketing-card' ) }
|
2020-10-23 06:41:45 +00:00
|
|
|
>
|
|
|
|
<CardHeader>
|
|
|
|
<div>
|
2021-06-28 01:14:59 +00:00
|
|
|
<Text
|
|
|
|
variant="title.small"
|
|
|
|
as="p"
|
|
|
|
size="20"
|
|
|
|
lineHeight="28px"
|
|
|
|
>
|
|
|
|
{ title }
|
|
|
|
</Text>
|
2020-10-23 06:41:45 +00:00
|
|
|
<Text
|
|
|
|
variant="subtitle.small"
|
2021-06-28 01:14:59 +00:00
|
|
|
as="p"
|
2020-10-23 06:41:45 +00:00
|
|
|
className="woocommerce-admin-marketing-card-subtitle"
|
2021-06-28 01:14:59 +00:00
|
|
|
size="14"
|
|
|
|
lineHeight="20px"
|
2020-10-23 06:41:45 +00:00
|
|
|
>
|
|
|
|
{ description }
|
|
|
|
</Text>
|
|
|
|
</div>
|
|
|
|
</CardHeader>
|
|
|
|
<CardBody>{ children }</CardBody>
|
|
|
|
</WPCard>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
Card.propTypes = {
|
|
|
|
/**
|
|
|
|
* Card title.
|
|
|
|
*/
|
|
|
|
title: PropTypes.string,
|
|
|
|
/**
|
|
|
|
* Card description.
|
|
|
|
*/
|
|
|
|
description: PropTypes.string,
|
|
|
|
/**
|
|
|
|
* Additional class name to style the component.
|
|
|
|
*/
|
|
|
|
className: PropTypes.string,
|
|
|
|
/**
|
|
|
|
* A renderable component (or string) which will be displayed as the content of this item. Generally a `ToggleControl`.
|
|
|
|
*/
|
|
|
|
children: PropTypes.node,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Card;
|