import { ChevronRight, Database, Globe, Rocket, Settings, Shield, Wrench } from "lucide-react"; import { __, sprintf } from "@wordpress/i18n"; import { cn } from "@/lib/utils"; const { help } = window.SPCDash; const DocumentationCategories = () => { const colors = [ 'text-green-600 bg-green-600/20', 'text-orange-600 bg-orange-600/20', 'text-blue-600 bg-blue-600/20', 'text-purple-600 bg-purple-600/20', 'text-indigo-600 bg-indigo-600/20', 'text-red-600 bg-red-600/20', ]; const iconMap = { 'rocket': Rocket, 'wrench': Wrench, 'settings': Settings, 'globe': Globe, 'database': Database, 'shield': Shield, } const categories = help.categories; if (!categories?.length) { return null; } return (

{__('Documentation Categories', 'wp-cloudflare-page-cache')}

{categories.map((category, index) => { const Icon = iconMap[category.icon as keyof typeof iconMap] || Settings; return (

{category.title}

{category.description}

{category.article_count && ( <> {/* translators: %d is the number of articles */ sprintf(__('%d articles', 'wp-cloudflare-page-cache'), category.article_count)} )}
); })}
) } export default DocumentationCategories;