feat(weather): show trend indicators on team averages

This commit is contained in:
2026-03-04 08:34:23 +01:00
parent 4aea17124e
commit 8bff21bede
2 changed files with 93 additions and 8 deletions

View File

@@ -40,6 +40,16 @@ export default async function WeatherSessionPage({ params }: WeatherSessionPageP
getUserTeams(authSession.user.id),
getWeatherSessionsHistory(authSession.user.id),
]);
const currentHistoryIndex = history.findIndex((point) => point.sessionId === session.id);
const previousTeamAverages =
currentHistoryIndex > 0
? {
performance: history[currentHistoryIndex - 1].performance,
moral: history[currentHistoryIndex - 1].moral,
flux: history[currentHistoryIndex - 1].flux,
valueCreation: history[currentHistoryIndex - 1].valueCreation,
}
: null;
return (
<main className="mx-auto max-w-7xl px-4">
@@ -70,7 +80,7 @@ export default async function WeatherSessionPage({ params }: WeatherSessionPageP
canEdit={session.canEdit}
userTeams={userTeams}
>
<WeatherAverageBar entries={session.entries} />
<WeatherAverageBar entries={session.entries} previousAverages={previousTeamAverages} />
<WeatherBoard
sessionId={session.id}
currentUserId={authSession.user.id}