Spaces:
Build error

File size: 5,186 Bytes
21a368c
 
 
 
 
 
 
 
 
6ea8f56
21a368c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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>
  );
}