import React, {useState, useEffect} from 'react'; import { __ } from '@wordpress/i18n'; import { getDashboardStats, type DashboardStats } from '../../api'; import FeatureCard from './components/FeatureCard'; const Features = () => { const [stats, setStats] = useState(null); const [loading, setLoading] = useState(true); useEffect(() => { getDashboardStats() .then((res: any) => { if (res?.data) { setStats(res.data); } }) .finally(() => setLoading(false)); }, []); return (

What Pro Fixes Today

Every Pro feature is designed to solve a specific real problem. Here's what exactly an upgrade unlocks.

)} subtitle={!loading && stats?.large_images && stats.large_images > 0 ? `${stats.large_images} images found!` : ''} title={__( 'Detect Large Images', 'image-sizes' )} description={__( 'Scan your media library and find oversized images instantly. See exactly which files are bloating your pages and fix them before they cost you rankings.', 'image-sizes' )} link={( )} /> )} subtitle={!loading && stats?.unused_images && stats.unused_images > 0 ? `${stats.unused_images} images found!` : ''} title={__( 'Delete Unused Images', 'image-sizes' )} description={__( 'Scan your media library and find unused images instantly. See exactly which files are taking up space and delete them to reclaim server space.', 'image-sizes' )} link={( )} /> )} subtitle={!loading && stats?.unoptimized_images && stats.unoptimized_images > 0 ? `${stats.unoptimized_images} images found!` : ''} title={__( 'Compress Large Images', 'image-sizes' )} description={__( 'Large images are costing you speed. Optimize them without visible loss and deliver a faster, smoother browsing experience.', 'image-sizes' )} link={( )} /> )} subtitle={!loading && stats?.not_avif && stats.not_avif > 0 ? `${stats.not_avif} images found!` : ''} title={__( 'Bulk Convert to AVIF', 'image-sizes' )} description={__( "Your images shouldn't be stuck in the past. Convert them all to AVIF - the format the modern web is built on - in a single click.", 'image-sizes' )} link={( )} /> )} subtitle={''} title={__( 'Image Editor', 'image-sizes' )} description={__( 'Crop, resize, or tweak any image right inside your WordPress dashboard. No need to re-upload or touch a third-party tool.', 'image-sizes' )} link={( )} /> )} subtitle={!loading && stats?.duplicate_images && stats.duplicate_images > 0 ? `${stats.duplicate_images} images found!` : ''} title={__( 'Merge Duplicate Images', 'image-sizes' )} description={__( 'Find images that have been uploaded more than once. Clean up the clutter and stop wasting space on files you already have.', 'image-sizes' )} link={( )} />
); }; export default Features;