Spaces:
Running
Running
Upload components/Sidebar.js with huggingface_hub
Browse files6 unmodified lines7891011121314151617181920212223242526272829303 unmodified lines343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081826 unmodified linesactiveConceptId,onConceptSelect,concepts,filteredConcepts}) => {return (<aside className="w-80 bg-gray-800 border-r border-gray-700 flex flex-col h-full"><div className="p-4 border-b border-gray-700"><div className="flex items-center justify-between mb-4"><h3 className="text-xs font-bold uppercase tracking-wider text-gray-400">ICT Knowledge Base</h3><span className="text-xs text-gray-500">{filteredConcepts.length} results</span></div><div className="space-y-1">{categories.map((category) => (<buttonkey={category.id}onClick={() => onSelectCategory(category.id)}className={`w-full text-left px-3 py-2 rounded-md text-sm font-medium transition-colors ${selectedCategory === category.id? 'bg-blue-600/20 text-blue-400 border border-blue-500/30': 'text-gray-300 hover:bg-gray-700'}`}>{category.name}3 unmodified lines</div></div><div className="flex-1 overflow-y-auto p-3 space-y-1">{filteredConcepts.length === 0 ? (<div className="flex flex-col items-center justify-center h-full text-gray-500 text-sm"><i className="fa-regular fa-folder-open text-4xl mb-3 opacity-20"></i><p>No concepts found</p></div>) : (filteredConcepts.map((concept) => (<divkey={concept.id}onClick={() => onConceptSelect(concept.id)}className={`group relative p-3 rounded-lg cursor-pointer transition-all duration-200 border ${activeConceptId === concept.id? 'bg-blue-600/10 border-blue-500/30 shadow-lg shadow-blue-500/5': 'border-transparent hover:bg-gray-700 hover:border-gray-600'}`}><div className="flex items-start gap-3"><div className="mt-1 p-1.5 bg-gray-700 rounded text-gray-300"><i className={`fa-solid ${getIconForType(concept.type)}`}></i></div><div className="flex-1 min-w-0"><h4 className="font-medium text-gray-200 truncate">{concept.title}</h4><p className="text-xs text-gray-400 mt-1 line-clamp-2">{concept.description}</p><div className="flex items-center gap-2 mt-2"><span className="text-[10px] px-2 py-0.5 rounded-full bg-green-500/10 text-green-400 border border-green-500/20">{concept.confidence}%</span><span className="text-[10px] px-2 py-0.5 rounded-full bg-blue-500/10 text-blue-400 border border-blue-500/20">{concept.type}</span></div></div></div></div>)))}</div><div className="p-4 border-t border-gray-700"><div className="flex items-center gap-2 text-xs text-gray-400"><i className="fa-solid fa-database"></i><span>{concepts.length} concepts loaded</span></div></div></aside>6 unmodified lines789101112131415161718192021222324252627282930313233343536373839404142434445463 unmodified lines50515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091106 unmodified linesactiveConceptId,onConceptSelect,concepts,filteredConcepts,onAddFile}) => {return (<aside className="w-80 bg-gray-800 border-r border-gray-700 flex flex-col h-full shadow-xl z-40"><div className="p-4 border-b border-gray-700 bg-gray-800"><div className="flex items-center justify-between mb-4"><h3 className="text-xs font-bold uppercase tracking-wider text-gray-400">ICT Knowledge Base</h3><span className="text-xs text-gray-500 bg-gray-900 px-2 py-0.5 rounded-md">{filteredConcepts.length} results</span></div><div className="flex items-center justify-between mb-4"><div className="flex items-center gap-2 text-gray-400 text-xs"><i className="fa-solid fa-database"></i><span>{concepts.length} loaded</span></div><buttononClick={onAddFile}className="text-[10px] text-blue-400 hover:text-blue-300 hover:underline"title="Simulate adding a new JSON file">+ Add File</button></div><div className="space-y-1">{categories.map((category) => (<buttonkey={category.id}onClick={() => onSelectCategory(category.id)}className={`w-full text-left px-3 py-2 rounded-md text-sm font-medium transition-all duration-200 ${selectedCategory === category.id? 'bg-blue-600/20 text-blue-400 border border-blue-500/30 shadow-sm': 'text-gray-300 hover:bg-gray-700/50 hover:text-gray-100'}`}>{category.name}3 unmodified lines</div></div><div className="flex-1 overflow-y-auto p-3 space-y-2 scrollbar-thin scrollbar-thumb-gray-700 scrollbar-track-transparent">{filteredConcepts.length === 0 ? (<div className="flex flex-col items-center justify-center h-full text-gray-500 text-sm p-4"><i className="fa-regular fa-folder-open text-4xl mb-3 opacity-20"></i><p>No concepts found matching criteria</p></div>) : (filteredConcepts.map((concept) => (<divkey={concept.id}onClick={() => onConceptSelect(concept.id)}className={`group relative p-3 rounded-lg cursor-pointer transition-all duration-200 border hover:shadow-md ${activeConceptId === concept.id? 'bg-gradient-to-br from-blue-600/10 to-blue-700/5 border-blue-500/40 shadow-lg shadow-blue-900/20': 'border-gray-700/50 hover:bg-gray-700 hover:border-gray-600'}`}><div className="flex items-start gap-3"><div className={`mt-1 p-1.5 rounded text-sm ${concept.type === 'core_concept' ? 'bg-blue-500/20 text-blue-400' :concept.type === 'strategy' ? 'bg-purple-500/20 text-purple-400' :concept.type === 'risk_management' ? 'bg-red-500/20 text-red-400' :'bg-orange-500/20 text-orange-400'}`}><i className={`fa-solid ${getIconForType(concept.type)}`}></i></div><div className="flex-1 min-w-0"><h4 className="font-medium text-gray-200 truncate text-sm">{concept.title}</h4><p className="text-xs text-gray-400 mt-1 line-clamp-2 leading-relaxed">{concept.description}</p><div className="flex items-center gap-2 mt-2"><span className="text-[10px] px-2 py-0.5 rounded-full bg-green-500/10 text-green-400 border border-green-500/20 font-medium">{concept.confidence}% Confidence</span><span className="text-[10px] px-2 py-0.5 rounded-full bg-gray-700 text-gray-300 border border-gray-600 uppercase tracking-wide">{concept.type.replace('_', ' ')}</span></div></div></div><div className="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity"><i className="fa-solid fa-chevron-right text-xs text-gray-500"></i></div></div>)))}</div><div className="p-3 border-t border-gray-700 bg-gray-800/50 text-xs text-gray-500 flex justify-between items-center"><div className="flex items-center gap-2"><i className="fa-solid fa-server"></i><span>v1.0.4</span></div><div className="flex items-center gap-2"><div className="w-2 h-2 rounded-full bg-green-500"></div><span>Synced</span></div></div></aside>
components/Sidebar.js+52-24