chore: initial import

This commit is contained in:
u1
2026-01-06 12:33:47 +01:00
commit ed37565e25
38 changed files with 5707 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
import Button from '../../ui/Button';
type Props = {
timeframe: string;
onTimeframeChange: (tf: string) => void;
showIndicators: boolean;
onToggleIndicators: () => void;
seriesLabel: string;
isFullscreen: boolean;
onToggleFullscreen: () => void;
};
const timeframes = ['1m', '5m', '15m', '1h', '4h', '1D'] as const;
export default function ChartToolbar({
timeframe,
onTimeframeChange,
showIndicators,
onToggleIndicators,
seriesLabel,
isFullscreen,
onToggleFullscreen,
}: Props) {
return (
<div className="chartToolbar">
<div className="chartToolbar__group">
{timeframes.map((tf) => (
<Button
key={tf}
size="sm"
variant={tf === timeframe ? 'primary' : 'ghost'}
onClick={() => onTimeframeChange(tf)}
type="button"
>
{tf}
</Button>
))}
</div>
<div className="chartToolbar__group">
<Button size="sm" variant={showIndicators ? 'primary' : 'ghost'} onClick={onToggleIndicators} type="button">
Indicators
</Button>
<Button size="sm" variant={isFullscreen ? 'primary' : 'ghost'} onClick={onToggleFullscreen} type="button">
{isFullscreen ? 'Exit' : 'Fullscreen'}
</Button>
<div className="chartToolbar__meta">{seriesLabel}</div>
</div>
</div>
);
}