Spaces:
Build error

anycoder-4c742612 / components /KnowledgeBase.js
powerllm's picture
Upload components/KnowledgeBase.js with huggingface_hub
6ea8f56 verified
Raw History Blame Contribute Delete
5.19 kB
import { Book, Brain, FileJson, Upload } from 'lucide-react';
const knowledgeRules = [
{
id: 'OB_01',
title: 'Bullish Order Block',
category: 'Market Structure',
description: 'The last down candle before a strong upward move that breaks structure.',
conditions: ['Break of Structure (BOS)', 'Imbalance created', 'Liquidity taken'],
videoId: 'dQw4w9WgXcQ'
},
{
id: 'FVG_01',
title: 'Fair Value Gap',
category: 'Inefficiency',
description: 'A three-candle pattern where the wicks of the first and third candle do not overlap.',
conditions: ['Large displacement candle', 'Wick gap presence', 'Retracement entry'],
videoId: 'dQw4w9WgXcQ'
},
{
id: 'LIQ_01',
title: 'Liquidity Sweep',
category: 'Manipulation',
description: 'Price moves above/below a key level to trigger stops before reversing.',
conditions: ['Equal Highs/Lows', 'Stop hunt', 'Rejection wick'],
videoId: 'dQw4w9WgXcQ'
}
];
export default function KnowledgeBase() {
return (
<div className="space-y-6">
<div className="flex justify-between items-end">
<div>
<h2 className="text-3xl font-bold text-white">ICT Knowledge Base</h2>
<p className="text-slate-400 mt-1">Dynamic rule engine for signal generation</p>
</div>
<button className="flex items-center space-x-2 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition-colors">
<Upload size={18} />
<span>Import Transcript JSON</span>
</button>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<div className="md:col-span-1 space-y-6">
<div className="glass-panel p-6 bg-gradient-to-br from-blue-900/40 to-slate-900/40 border-blue-800/30">
<div className="flex items-center space-x-3 mb-4">
<div className="p-2 bg-blue-600/20 rounded-lg text-blue-400">
<Brain size={24} />
</div>
<h3 className="font-bold text-white">AI Learning Engine</h3>
</div>
<p className="text-sm text-slate-300 mb-4">
Convert YouTube transcripts into structured JSON rules. The system automatically parses conditions, entry criteria, and invalidation points.
</p>
<div className="space-y-2">
<div className="flex items-center text-xs text-slate-400">
<FileJson size={14} className="mr-2" />
<span>Auto-validates JSON schema</span>
</div>
<div className="flex items-center text-xs text-slate-400">
<Book size={14} className="mr-2" />
<span>Supports multi-confluence</span>
</div>
</div>
</div>
<div className="glass-panel p-6">
<h3 className="font-bold text-white mb-4">System Stats</h3>
<div className="space-y-4">
<div>
<div className="flex justify-between text-sm mb-1">
<span className="text-slate-400">Rules Loaded</span>
<span className="text-white">42</span>
</div>
<div className="w-full bg-slate-700 rounded-full h-1.5">
<div className="bg-blue-500 h-1.5 rounded-full" style={{ width: '85%' }}></div>
</div>
</div>
<div>
<div className="flex justify-between text-sm mb-1">
<span className="text-slate-400">Accuracy Rate</span>
<span className="text-white">92%</span>
</div>
<div className="w-full bg-slate-700 rounded-full h-1.5">
<div className="bg-emerald-500 h-1.5 rounded-full" style={{ width: '92%' }}></div>
</div>
</div>
</div>
</div>
</div>
<div className="md:col-span-2 space-y-4">
{knowledgeRules.map((rule) => (
<div key={rule.id} className="glass-panel p-5 hover:bg-slate-800/50 transition-colors cursor-pointer border-l-4 border-l-blue-500">
<div className="flex justify-between items-start">
<div>
<div className="flex items-center space-x-2 mb-1">
<span className="text-xs font-mono text-blue-400 bg-blue-900/30 px-2 py-0.5 rounded">{rule.id}</span>
<span className="text-xs text-slate-500 uppercase tracking-wide">{rule.category}</span>
</div>
<h3 className="text-lg font-bold text-white">{rule.title}</h3>
<p className="text-slate-400 text-sm mt-1">{rule.description}</p>
</div>
</div>
<div className="mt-4 flex flex-wrap gap-2">
{rule.conditions.map((cond, idx) => (
<span key={idx} className="text-xs bg-slate-900 text-slate-300 px-2 py-1 rounded border border-slate-700">
{cond}
</span>
))}
</div>
</div>
))}
</div>
</div>
</div>
);
}