Spaces:
Runtime error
Runtime error
Download components/SettingsModal.jsx from Maximm7/anycoder-30d45a35: direct link, hf CLI and curl.
- Browser
- Download file 2.25 kB
-
https://huggingface.co/spaces/Maximm7/anycoder-30d45a35/resolve/main/components/SettingsModal.jsx
- Command line
-
hf download hf://spaces/Maximm7/anycoder-30d45a35/components/SettingsModal.jsx
-
curl -L -o SettingsModal.jsx https://huggingface.co/spaces/Maximm7/anycoder-30d45a35/resolve/main/components/SettingsModal.jsx
2.25 kB
| 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 |