refactor: encapsulate instrument chart data
Frontend verify / commits (pull_request) Successful in 27s
Frontend verify / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 8m45s

This commit is contained in:
2026-09-28 20:46:06 +03:00
parent fb3a5a6eaa
commit 64fe902192
7 changed files with 50 additions and 65 deletions
@@ -7,17 +7,13 @@ type Candles = NonNullable<
paths["/api/v1/stocks/{uid}/candles"]["get"]["responses"][200]["content"]["application/json"]["data"]
>;
type ChartRow = Candles["candles"][number] & { date: string; price: number };
type InstrumentChartProps = { priceUnit?: "percent"; vm: InstrumentChartVm };
type InstrumentChartVm = {
averageLine: null | number;
candles?: Candles;
candlesState: SectionState;
chartData: ChartRow[];
hasIncompleteCandle: boolean;
period: string;
position?: Position;
priceRows: ChartRow[];
setPeriod: (value: string) => void;
};
@@ -41,4 +37,4 @@ type Position = NonNullable<
paths["/api/v1/stocks/{uid}/position"]["get"]["responses"][200]["content"]["application/json"]["data"]
>;
export type { InstrumentChartVm, InstrumentEventsVm, InstrumentPositionVm };
export type { InstrumentChartProps, InstrumentEventsVm, InstrumentPositionVm };