import { useState, useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { Network, Code2, ListChecks, ArrowRight, ChevronRight } from 'lucide-react' import { sidebarApi } from '@/api' import { Skeleton } from '@/components/ui/Skeleton' export function KnowledgeBaseCards() { const navigate = useNavigate() const [flowCount, setFlowCount] = useState(0) const [loading, setLoading] = useState(true) useEffect(() => { sidebarApi.getStats() .then((stats) => setFlowCount(stats.tree_counts.total)) .catch(() => {}) .finally(() => setLoading(false)) }, []) const items = [ { label: 'Flows', value: flowCount, icon: Network, color: '#a78bfa', href: '/trees' }, { label: 'Scripts', value: '\u2014', icon: Code2, color: '#2dd4bf', href: '/scripts' }, { label: 'Pending Review', value: '\u2014', icon: ListChecks, color: '#fbbf24', href: '/review-queue' }, ] return (

Knowledge Base

{loading ? Array.from({ length: 3 }).map((_, i) => (
)) : items.map((item, i) => ( ))}
) }