Spaces:
Runtime error

File size: 2,247 Bytes
c859197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import React from 'react'
import { X } from 'lucide-react'
import { Button } from './ui/button'

const SettingsModal = ({ isOpen, onClose, chartType, setChartType, theme, setTheme }) => {
  if (!isOpen) return null

  const chartTypes = [
    { id: 'candlestick', label: 'Свічковий графік' },
    { id: 'line', label: 'Лінійний графік' },
    { id: 'area', label: 'Графік з областю' },
  ]

  return (
    <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4">
      <div className="bg-card border rounded-xl shadow-lg w-full max-w-md p-6 space-y-4">
        <div className="flex items-center justify-between">
          <h2 className="text-lg font-semibold">Налаштування графіка</h2>
          <Button variant="ghost" size="icon" onClick={onClose}>
            <X className="h-4 w-4" />
          </Button>
        </div>
        
        <div className="space-y-4">
          <div className="space-y-2">
            <label className="text-sm font-medium">Тип графіка</label>
            <div className="flex gap-2">
              {chartTypes.map((type) => (
                <Button
                  key={type.id}
                  variant={chartType === type.id ? 'default' : 'outline'}
                  size="sm"
                  onClick={() => setChartType(type.id)}
                >
                  {type.label}
                </Button>
              ))}
            </div>
          </div>

          <div className="space-y-2">
            <label className="text-sm font-medium">Тема</label>
            <div className="flex gap-2">
              <Button
                variant={theme === 'light' ? 'default' : 'outline'}
                size="sm"
                onClick={() => setTheme('light')}
              >
                Світла
              </Button>
              <Button
                variant={theme === 'dark' ? 'default' : 'outline'}
                size="sm"
                onClick={() => setTheme('dark')}
              >
                Темна
              </Button>
            </div>
          </div>
        </div>
      </div>
    </div>
  )
}

export default SettingsModal