feat: update loyalty overview table ui

This commit is contained in:
Matilda Landström
2024-06-28 10:13:32 +02:00
parent 1c76725b4c
commit 1186511038
35 changed files with 433 additions and 396 deletions

13
utils/loyaltyTable.ts Normal file
View File

@@ -0,0 +1,13 @@
import { ComparisonLevel } from "@/types/components/loyalty/blocks"
export function getHighestLevel(levels: ComparisonLevel[]) {
return levels.reduce(
(acc: ComparisonLevel | null, level: ComparisonLevel) => {
if (!acc) {
return level
}
return level.level > acc.level ? level : acc
},
null
)
}