import { __ } from "@wordpress/i18n"; import React from "react"; import { Donut, HBar, Sparkline } from "../../analytics/components/common/charts"; import { I } from "../../analytics/components/common/icons"; import { Badge, Card } from "../../analytics/components/common/ui"; import { FauxBtn } from "./primitives"; /** * Inert mock of Pro's Content Health Score screen * (betterdocs-pro/react-src/admin/content-intelligence/views/HealthView.js): * the composite score donut with its month-over-month trend, the five scored * components with the weakest one called out, the distribution across every * published doc, and the articles dragging the average down. */ const SCORE = 78; const GRADE = "B"; const COLOR = "#16C098"; // The five components of the composite score (Pro's `COMPONENTS`), with a // plausible reading for each. Freshness is deliberately the weak one — that is // what makes the "weakest area" callout below say something. const COMPONENTS = [ { name: __( "Engagement", "betterdocs" ), value: 82 }, { name: __( "Helpfulness", "betterdocs" ), value: 88 }, { name: __( "Freshness", "betterdocs" ), value: 61 }, { name: __( "Findability", "betterdocs" ), value: 74 }, { name: __( "Accuracy", "betterdocs" ), value: 79 } ]; const DISTRIBUTION = [ { name: "81-100", value: 34, color: "#16C098" }, { name: "61-80", value: 41, color: "#16C098" }, { name: "41-60", value: 18, color: "#f59e0b" }, { name: "21-40", value: 7, color: "#ef4444" }, { name: "0-20", value: 3, color: "#ef4444" } ]; const UNDER = [ { t: "Legacy Shortcode Reference", cat: "Reference", grade: "F", score: 31, weak: __( "Accuracy", "betterdocs" ) }, { t: "Installing on WordPress Multisite", cat: "Getting Started", grade: "D", score: 44, weak: __( "Freshness", "betterdocs" ) }, { t: "Configuring Live Search Filters", cat: "Search", grade: "D", score: 48, weak: __( "Findability", "betterdocs" ) }, { t: "Customizing the KB Layout", cat: "Design", grade: "C", score: 57, weak: __( "Engagement", "betterdocs" ) } ]; const GRADE_COLOR = { A: "#16C098", B: "#16C098", C: "#f59e0b", D: "#f97316", F: "#ef4444" }; const barColor = ( v ) => ( v >= 75 ? "#16C098" : v >= 60 ? "#f59e0b" : "#ef4444" ); export default function HealthMock() { return (
| { __( "Doc", "betterdocs" ) } | { __( "Health", "betterdocs" ) } | { __( "Weakest area", "betterdocs" ) } | { __( "Action", "betterdocs" ) } |
|---|---|---|---|
|
{ u.t }
{ u.cat }
|
{ u.grade }
{ u.score }
|
|