diff --git a/src/compensations/Compensations.tsx b/src/compensations/Compensations.tsx
index fa4cc3506..7f2cac51a 100644
--- a/src/compensations/Compensations.tsx
+++ b/src/compensations/Compensations.tsx
@@ -12,6 +12,7 @@ import {
IOption,
RadioButtonGroup,
} from "src/components/forms/radioButtonGroup/RadioButtonGroup";
+import YearlyBonuses from "./components/yearlyBonuses/YearlyBonuses";
import BenefitsByLocation from "./components/benefitsByLocation/BenefitsByLocation";
interface CompensationsProps {
@@ -70,6 +71,10 @@ const Compensations = ({ compensations, locations }: CompensationsProps) => {
(benefit) => benefit.location._ref === selectedLocation,
)?.benefits || [];
+ const yearlyBonusesForLocation = compensations.bonusesByLocation.find(
+ (b) => b.location._ref === selectedLocation,
+ )?.yearlyBonuses;
+
return (
{compensations.basicTitle}
@@ -102,6 +107,9 @@ const Compensations = ({ compensations, locations }: CompensationsProps) => {
) : null}
>
)}
+ {yearlyBonusesForLocation && (
+
+ )}
);
diff --git a/src/compensations/components/yearlyBonuses/YearlyBonuses.tsx b/src/compensations/components/yearlyBonuses/YearlyBonuses.tsx
new file mode 100644
index 000000000..78c65167f
--- /dev/null
+++ b/src/compensations/components/yearlyBonuses/YearlyBonuses.tsx
@@ -0,0 +1,43 @@
+import { BonusPage } from "studio/lib/payloads/compensations";
+import Text from "../../../components/text/Text";
+import styles from "./yearlyBonuses.module.css";
+
+interface YearlyBonusesProps {
+ bonuses: BonusPage[];
+}
+
+const YearlyBonuses = ({ bonuses }: YearlyBonusesProps) => {
+ return (
+
+
Historisk bonus
+
+
+
+
+ År
+ |
+
+ Beløp
+ |
+
+
+
+ {bonuses
+ .sort((a, b) => b.year - a.year)
+ .map((bonus) => (
+
+
+ {bonus.year}
+ |
+
+ {bonus.bonus}
+ |
+
+ ))}
+
+
+
+ );
+};
+
+export default YearlyBonuses;
diff --git a/src/compensations/components/yearlyBonuses/yearlyBonuses.module.css b/src/compensations/components/yearlyBonuses/yearlyBonuses.module.css
new file mode 100644
index 000000000..df84061e6
--- /dev/null
+++ b/src/compensations/components/yearlyBonuses/yearlyBonuses.module.css
@@ -0,0 +1,15 @@
+.wrapper {
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
+}
+
+.table {
+ text-align: left;
+ max-width: 500px;
+}
+
+.bonusHeader,
+.bonusCell {
+ text-align: right;
+}
diff --git a/studio/lib/payloads/compensations.ts b/studio/lib/payloads/compensations.ts
index 49d425cce..4ee5549ef 100644
--- a/studio/lib/payloads/compensations.ts
+++ b/studio/lib/payloads/compensations.ts
@@ -1,5 +1,5 @@
import { PortableTextBlock } from "src/components/richText/RichText";
-import { Slug } from "./global";
+import { Reference, Slug } from "./global";
export interface Benefit {
_type: string;
@@ -21,6 +21,13 @@ export interface SalariesPage {
salaries: string;
}
+export interface BonusesByLocationPage {
+ _type: string;
+ _key: string;
+ location: Reference;
+ yearlyBonuses: BonusPage[];
+}
+
export interface BonusPage {
_type: string;
_key: string;
@@ -39,10 +46,6 @@ export interface CompensationsPage {
slug: Slug;
pensionPercent?: number;
benefitsByLocation: BenefitsByLocation[];
+ bonusesByLocation: BonusesByLocationPage[];
showSalaryCalculator: boolean;
}
-
-export interface Reference {
- _type: "reference";
- _ref: string;
-}
diff --git a/studio/lib/payloads/global.ts b/studio/lib/payloads/global.ts
index 445bf15f9..1be127644 100644
--- a/studio/lib/payloads/global.ts
+++ b/studio/lib/payloads/global.ts
@@ -2,3 +2,8 @@ export interface Slug {
_type: string;
current: string;
}
+
+export interface Reference {
+ _type: "reference";
+ _ref: string;
+}