import React from 'react'; import { __, sprintf } from '@wordpress/i18n'; import { ArrowRight, Search } from 'lucide-react'; import { gradeStyle, type HeroModel } from './model'; /** The one dark block: how healthy the library is, what is worst, and what to click. */ export default function GradeHero( { grade, score, hero, onScan, onFixAll, busy }: { grade: string; score: number; hero: HeroModel; onScan: () => void; onFixAll: () => void; busy: boolean; } ) { const style = gradeStyle( grade ); const trendColour = hero.trendDir === 'down' ? '#FED7AA' : hero.trendDir === 'up' ? '#A7F3D0' : '#C9BFF0'; const cta = ( <> { hero.cta.label } > ); const ctaClass = 'h-11 px-[22px] rounded-lg bg-white !text-thumbpress-primary text-[15px] font-semibold inline-flex items-center gap-2 no-underline cursor-pointer disabled:opacity-60 disabled:cursor-default'; return ( { hero.never ? ( ) : ( { grade } ) } { __( 'Media Health', 'image-sizes' ) } { hero.partial && ( { __( 'Partial data', 'image-sizes' ) } ) } { ! hero.never && ( { score } / 100 { hero.trend && ( { hero.trend } ) } ) } { hero.sentence } { hero.cta.scan || hero.cta.fixAll ? ( { cta } ) : ( { cta } ) } { hero.ctaNote } ); }
{ hero.sentence }