2022-12-13 13:35:01 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2022-12-13 13:35:01 +00:00
|
|
|
|
2022-09-14 07:43:30 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { CardBody } from '~/marketing/components';
|
|
|
|
import './PluginCardBody.scss';
|
|
|
|
|
|
|
|
type PluginCardBodyProps = {
|
2022-12-13 13:35:01 +00:00
|
|
|
className?: string;
|
2022-09-14 07:43:30 +00:00
|
|
|
icon: JSX.Element;
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WooCommerce's Pill component to be rendered beside the name.
|
|
|
|
*/
|
|
|
|
pills?: Array< JSX.Element >;
|
|
|
|
|
2022-12-13 13:35:01 +00:00
|
|
|
description: React.ReactNode;
|
2022-09-14 07:43:30 +00:00
|
|
|
button?: JSX.Element;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders a CardBody layout component to display plugin info and button.
|
|
|
|
*/
|
|
|
|
export const PluginCardBody: React.FC< PluginCardBodyProps > = ( {
|
2022-12-13 13:35:01 +00:00
|
|
|
className,
|
2022-09-14 07:43:30 +00:00
|
|
|
icon,
|
|
|
|
name,
|
|
|
|
pills,
|
|
|
|
description,
|
|
|
|
button,
|
|
|
|
} ) => {
|
|
|
|
return (
|
2022-12-13 13:35:01 +00:00
|
|
|
<CardBody
|
2024-05-31 03:49:36 +00:00
|
|
|
className={ clsx(
|
2022-12-13 13:35:01 +00:00
|
|
|
'woocommerce_marketing_plugin_card_body',
|
|
|
|
className
|
|
|
|
) }
|
|
|
|
>
|
2022-09-14 07:43:30 +00:00
|
|
|
<div className="woocommerce_marketing_plugin_card_body__icon">
|
|
|
|
{ icon }
|
|
|
|
</div>
|
|
|
|
<div className="woocommerce_marketing_plugin_card_body__details">
|
|
|
|
<div className="woocommerce_marketing_plugin_card_body__details-name">
|
|
|
|
{ name }
|
|
|
|
{ pills }
|
|
|
|
</div>
|
|
|
|
<div className="woocommerce_marketing_plugin_card_body__details-description">
|
|
|
|
{ description }
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{ button }
|
|
|
|
</CardBody>
|
|
|
|
);
|
|
|
|
};
|