'use client';
interface ChartControlsProps {
mainIndicator: string;
setMainIndicator: (val: string) => void;
subIndicator1: string;
setSubIndicator1: (val: string) => void;
subIndicator2: string;
setSubIndicator2: (val: string) => void;
period: 'day' | 'week' | 'month';
setPeriod: (val: 'day' | 'week' | 'month') => void;
}
export default function ChartControls({
mainIndicator, setMainIndicator,
subIndicator1, setSubIndicator1,
subIndicator2, setSubIndicator2,
period, setPeriod
}: ChartControlsProps) {
const mainOptions = ['MA', 'BOLL', 'ENE', 'HIDE'];
const subOptions = ['VOL', 'MACD', 'KDJ', 'RSI', 'WR', 'CCI', 'HIDE'];
const periods = [
{ label: '日K', value: 'day' },
{ label: '周K', value: 'week' },
{ label: '月K', value: 'month' },
];
return (
{/* 周期选择 */}
{periods.map(p => (
))}
主图
{mainOptions.map(opt => (
))}
副图1
{subOptions.map(opt => (
))}
副图2
{subOptions.map(opt => (
))}
);
}