// Knowledge Base view const KnowledgeBase = () => { const D = window.REGULA_DATA; const [scope, setScope] = React.useState('all'); const [filter, setFilter] = React.useState(''); const groups = [ { id: 'all', label: 'Tutti', count: D.docs.length }, { id: 'Gruppo', label: 'Gruppo', count: D.docs.filter(d => d.scope === 'Gruppo').length }, { id: 'MetalTech', label: 'MetalTech', count: D.docs.filter(d => d.scope === 'MetalTech').length }, { id: 'Aqua World', label: 'Aqua World', count: D.docs.filter(d => d.scope === 'Aqua World').length }, { id: 'Club Lumière', label: 'Club Lumière', count: D.docs.filter(d => d.scope === 'Club Lumière').length }, { id: 'Fondazione', label: 'Fondazione', count: D.docs.filter(d => d.scope === 'Fondazione').length } ]; const docs = D.docs.filter(d => (scope === 'all' || d.scope === scope) && (filter === '' || d.title.toLowerCase().includes(filter.toLowerCase())) ); return (