import React, { useMemo } from 'react';
import type { TrendSearchAppSettings } from '../../utils/trendSearchAppSettings';
import {
TREND_SEARCH_REFRESH_OPTIONS,
formatTrendRefreshLabel,
} from '../../utils/trendSearchAppSettings';
import TrendSearchBullishWeightsSection from './TrendSearchBullishWeightsSection';
interface Props {
settings: TrendSearchAppSettings;
onChange: (next: TrendSearchAppSettings) => void;
}
const SettingRow: React.FC<{
label: string;
desc?: string;
children: React.ReactNode;
}> = ({ label, desc, children }) => (
{label}
{desc && {desc}}
{children}
);
const SettingSection: React.FC<{ title: string; children: React.ReactNode }> = ({
title, children,
}) => (
);
const TrendSearchSettingsPanel: React.FC = ({ settings, onChange }) => {
const patch = (p: Partial) => onChange({ ...settings, ...p });
const weights = useMemo(() => ({
weightMaAlignment: settings.weightMaAlignment,
weightMaSlope: settings.weightMaSlope,
weightAdxTrend: settings.weightAdxTrend,
weightMacdMomentum: settings.weightMacdMomentum,
weightPricePosition: settings.weightPricePosition,
}), [settings]);
return (
patch(w)}
/>
patch({ minTrendScore: Number(e.target.value) })}
/>
patch({ limit: Number(e.target.value) })}
/>
patch({ scanLimit: Number(e.target.value) })}
/>
patch({ autoAddTopRank: Number(e.target.value) })}
/>
patch({ autoAddMinScore: Number(e.target.value) })}
/>
);
};
export default TrendSearchSettingsPanel;