refactor: tighten types and reuse instrument UI
This commit is contained in:
@@ -156,8 +156,9 @@ function toIncomeDisplayModel(
|
||||
return null;
|
||||
}
|
||||
|
||||
const previous = meta?.dependencies?.find(({ role }) => role === "previous");
|
||||
const year = meta?.dependencies?.find(({ role }) => role === "year");
|
||||
const dependencies = meta?.dependencies ?? [];
|
||||
const previous = dependencies.find(({ role }) => role === "previous");
|
||||
const year = dependencies.find(({ role }) => role === "year");
|
||||
|
||||
return {
|
||||
comparison: comparisonDisplay(analytics.period, analytics.yearComparison),
|
||||
|
||||
@@ -78,7 +78,7 @@ const analytics
|
||||
},
|
||||
totalsByCurrency: [summary("RUB", "10", "2")],
|
||||
yearComparison: null,
|
||||
} satisfies IncomeAnalytics;
|
||||
} satisfies IncomeAnalytics & { instruments: [unknown] };
|
||||
|
||||
function comparison(currency: string) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user