| 1 |
/** |
| 2 |
* One sentence answering "is anything wrong". |
| 3 |
* |
| 4 |
* Full width and directly under the figures, because it is the thing a store |
| 5 |
* owner opens this page to find out. |
| 6 |
*/ |
| 7 |
|
| 8 |
// TODO(refactor): replace @wordpress/components with our `wpsubs-*` admin |
| 9 |
// components (wpsubs-btn, …) — see src/dashboard/index.js. |
| 10 |
import { Button } from "@wordpress/components"; |
| 11 |
import Icon from "./Icon"; |
| 12 |
|
| 13 |
export default function HealthBanner({ health }) { |
| 14 |
const clear = health.state === "clear"; |
| 15 |
|
| 16 |
return ( |
| 17 |
<div className={`subscrpt-banner is-${health.state}`}> |
| 18 |
<span className="subscrpt-banner__badge"> |
| 19 |
<Icon name={clear ? "shield" : "alert"} size={20} /> |
| 20 |
</span> |
| 21 |
|
| 22 |
<div className="subscrpt-banner__body"> |
| 23 |
<p className="subscrpt-banner__title">{health.title}</p> |
| 24 |
<p className="subscrpt-banner__text">{health.text}</p> |
| 25 |
</div> |
| 26 |
|
| 27 |
{health.action && ( |
| 28 |
<Button variant="primary" href={health.action.url}> |
| 29 |
{health.action.label} |
| 30 |
</Button> |
| 31 |
)} |
| 32 |
</div> |
| 33 |
); |
| 34 |
} |
| 35 |
|