File size: 5,737 Bytes
7843862
 
c132c62
 
7843862
 
c132c62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299d1d7
c132c62
 
 
 
 
 
299d1d7
c132c62
7843862
c132c62
 
 
 
 
 
 
 
 
 
7843862
c132c62
 
 
7843862
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c132c62
 
 
299d1d7
c132c62
 
 
 
 
 
 
 
 
 
 
 
299d1d7
c132c62
 
 
7843862
299d1d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7843862
c132c62
 
 
299d1d7
c132c62
 
 
 
 
 
 
 
 
 
 
 
 
 
7843862
c132c62
 
 
299d1d7
c132c62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import { Activity, Bot, BookOpen, Layers, Settings, Sparkles, BarChart2 } from 'lucide-react';
import type { AppTab } from './Header';

interface MobileBottomNavProps {
  activeTab: AppTab;
  onTabChange: (tab: AppTab) => void;
  onOpenMobileDrawer: () => void;
  onOpenAISettings: () => void;
  activePairCount: number;
  isAIConfigured: boolean;
}

export function MobileBottomNav({
  activeTab,
  onTabChange,
  onOpenMobileDrawer,
  onOpenAISettings,
  activePairCount,
  isAIConfigured,
}: MobileBottomNavProps) {
  return (
    <nav
      className="md:hidden fixed bottom-0 left-0 right-0 z-40 bg-bg-card/95 backdrop-blur-md border-t border-border/80 flex items-center justify-around px-1 pt-1 pb-[max(0.35rem,env(safe-area-inset-bottom))] shadow-2xl"
      aria-label="Mobile Navigation"
    >
      {/* 1. Live Sinyal Tab */}
      <button
        type="button"
        onClick={() => onTabChange('signals')}
        className={`flex-1 flex flex-col items-center justify-center py-1 px-0.5 rounded-xl transition-all duration-150 active:scale-95 min-h-[44px] ${
          activeTab === 'signals'
            ? 'text-accent-blue font-semibold'
            : 'text-text-muted hover:text-text-secondary'
        }`}
      >
        <div className="relative">
          <Activity size={18} className={activeTab === 'signals' ? 'animate-pulse' : ''} />
          {activeTab === 'signals' && (
            <span className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-accent-blue" />
          )}
        </div>
        <span className="text-[10px] font-medium tracking-tight mt-0.5">
          Sinyal
        </span>
      </button>

      {/* 2. Live Chart Tab */}
      <button
        type="button"
        onClick={() => onTabChange('chart')}
        className={`flex-1 flex flex-col items-center justify-center py-1 px-0.5 rounded-xl transition-all duration-150 active:scale-95 min-h-[44px] ${
          activeTab === 'chart'
            ? 'text-sky-400 font-semibold'
            : 'text-text-muted hover:text-text-secondary'
        }`}
      >
        <div className="relative">
          <BarChart2 size={18} />
          {activeTab === 'chart' && (
            <span className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-sky-400" />
          )}
        </div>
        <span className="text-[10px] font-medium tracking-tight mt-0.5">
          Chart
        </span>
      </button>

      {/* 3. Damian Tab */}
      <button
        type="button"
        onClick={() => onTabChange('ai')}
        className={`flex-1 flex flex-col items-center justify-center py-1 px-0.5 rounded-xl transition-all duration-150 active:scale-95 min-h-[44px] ${
          activeTab === 'ai'
            ? 'text-purple-400 font-semibold'
            : 'text-text-muted hover:text-text-secondary'
        }`}
      >
        <div className="relative">
          <Bot size={18} />
          {activeTab === 'ai' && (
            <span className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-purple-400" />
          )}
        </div>
        <span className="text-[10px] font-medium tracking-tight mt-0.5">
          Damian
        </span>
      </button>

      {/* 4. Jurnal Trade Tab */}
      <button
        type="button"
        onClick={() => onTabChange('journal')}
        className={`flex-1 flex flex-col items-center justify-center py-1 px-0.5 rounded-xl transition-all duration-150 active:scale-95 min-h-[44px] ${
          activeTab === 'journal'
            ? 'text-emerald-400 font-semibold'
            : 'text-text-muted hover:text-text-secondary'
        }`}
      >
        <div className="relative">
          <BookOpen size={18} />
          {activeTab === 'journal' && (
            <span className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-emerald-400" />
          )}
        </div>
        <span className="text-[10px] font-medium tracking-tight mt-0.5">
          Jurnal
        </span>
      </button>

      {/* 5. Daftar Pairs (Drawer Trigger) */}
      <button
        type="button"
        onClick={onOpenMobileDrawer}
        className="flex-1 flex flex-col items-center justify-center py-1 px-0.5 rounded-xl text-text-muted hover:text-text-primary transition-all duration-150 active:scale-95 min-h-[44px]"
      >
        <div className="relative">
          <Layers size={18} />
          {activePairCount > 0 && (
            <span className="absolute -top-1 -right-2 px-1 py-0.2 bg-accent-blue/20 text-accent-blue border border-accent-blue/40 text-[9px] font-mono font-bold rounded-full leading-none">
              {activePairCount}
            </span>
          )}
        </div>
        <span className="text-[10px] font-medium tracking-tight mt-0.5">
          Pairs
        </span>
      </button>

      {/* 6. Atur AI Settings Modal Trigger */}
      <button
        type="button"
        onClick={onOpenAISettings}
        className="flex-1 flex flex-col items-center justify-center py-1 px-0.5 rounded-xl text-text-muted hover:text-text-primary transition-all duration-150 active:scale-95 min-h-[44px]"
      >
        <div className="relative">
          {isAIConfigured ? (
            <Sparkles size={18} className="text-purple-400" />
          ) : (
            <Settings size={18} className="text-amber-400 animate-pulse" />
          )}
          <span
            className={`absolute -top-0.5 -right-1 w-1.5 h-1.5 rounded-full ${
              isAIConfigured ? 'bg-signal-long' : 'bg-amber-400 animate-ping'
            }`}
          />
        </div>
        <span className="text-[10px] font-medium tracking-tight mt-0.5">
          Atur AI
        </span>
      </button>
    </nav>
  );
}