diff --git a/messages/en.json b/messages/en.json index 869bef251..c68cc6d20 100644 --- a/messages/en.json +++ b/messages/en.json @@ -47,7 +47,8 @@ "degreeOptions": { "bachelor": "Bachelor", "master": "Master" - } + }, + "no_compensation_data": "Whoops, the accounts seem to be on holiday. {city}, huh..." }, "employee_card": { "show": "Showing", diff --git a/messages/no.json b/messages/no.json index eb45d6cb6..803a181e7 100644 --- a/messages/no.json +++ b/messages/no.json @@ -43,7 +43,9 @@ "degreeOptions": { "bachelor": "Bachelor", "master": "Master" - } + }, + "test": "test", + "no_compensation_data": "Woops, regnskapet er på avveie. {city} altså..." }, "custom_link": { "visit_cv": "Gå til mini-CV", diff --git a/messages/se.json b/messages/se.json index d784bbc9a..3b5342ea5 100644 --- a/messages/se.json +++ b/messages/se.json @@ -43,7 +43,8 @@ "degreeOptions": { "bachelor": "Bachelor", "master": "Master" - } + }, + "no_compensation_data": "Hoppsan, bokföringen är på villovägar. {city} alltså..." }, "custom_link": { "visit_cv": "Besök mini-CV", diff --git a/src/components/compensations/CompensationSelector.tsx b/src/components/compensations/CompensationSelector.tsx index 64c4d620f..d1b2bd4a1 100644 --- a/src/components/compensations/CompensationSelector.tsx +++ b/src/components/compensations/CompensationSelector.tsx @@ -1,4 +1,5 @@ "use client"; +import { useTranslations } from "next-intl"; import { useState } from "react"; import { @@ -24,9 +25,14 @@ export default function CompensationSelector({ locations, locale, }: CompensationsProps) { + const t = useTranslations("compensation_calculator"); + const [selectedLocation, setSelectedLocation] = useState( locations[0]._id, ); + const [selectedLocationLabel, setSelectedLocationLabel] = useState( + locations[0].companyLocationName, + ); const locationOptions: IOption[] = locations.map((companyLocation) => ({ id: companyLocation._id, @@ -44,18 +50,27 @@ export default function CompensationSelector({ return (
- {yearlyBonusesForLocation && ( - - )} setSelectedLocation(option.id)} + onValueChange={(option) => { + setSelectedLocation(option.id); + setSelectedLocationLabel(option.label); + }} /> - + {yearlyBonusesForLocation && ( + + )} + {benefitsFilteredByLocation.length > 0 ? ( + + ) : ( + + {t("no_compensation_data", { city: selectedLocationLabel })} + + )}
); } diff --git a/src/components/compensations/Compensations.tsx b/src/components/compensations/Compensations.tsx index b6aca6a1f..93edf38cf 100644 --- a/src/components/compensations/Compensations.tsx +++ b/src/components/compensations/Compensations.tsx @@ -21,21 +21,23 @@ export default async function Compensations({ language, }: CompensationsProps) { return ( -
- - {compensations.basicTitle} - +
+
+ + {compensations.basicTitle} + - + - + +
); } diff --git a/src/components/compensations/compensations.module.css b/src/components/compensations/compensations.module.css index 6e8bbb0eb..c17ca4946 100644 --- a/src/components/compensations/compensations.module.css +++ b/src/components/compensations/compensations.module.css @@ -1,18 +1,25 @@ +.outerWrapper { + width: 100%; + display: flex; + justify-content: center; +} + .wrapper { display: flex; flex-direction: column; padding: 10rem 5rem; - gap: 5rem; - justify-content: center; + gap: 3rem; width: 100%; + max-width: var(--max-content-width-large); } .text { max-width: var(--max-content-width-large); - align-self: center; } .compensationWrapper { + display: flex; + flex-direction: column; max-width: var(--max-content-width-large); - align-self: center; + gap: 2rem; } diff --git a/src/components/compensations/components/benefitsByLocation/benefitsByLocation.module.css b/src/components/compensations/components/benefitsByLocation/benefitsByLocation.module.css index c4c1dfc0d..8299c163d 100644 --- a/src/components/compensations/components/benefitsByLocation/benefitsByLocation.module.css +++ b/src/components/compensations/components/benefitsByLocation/benefitsByLocation.module.css @@ -3,6 +3,7 @@ flex-direction: column; gap: 5rem; max-width: var(--max-content-width-medium); + padding-top: 4rem; } .benefitWrapper { diff --git a/src/components/sections/compensation-calculator/CompensationCalculator.tsx b/src/components/sections/compensation-calculator/CompensationCalculator.tsx index ed4f64728..64111110d 100644 --- a/src/components/sections/compensation-calculator/CompensationCalculator.tsx +++ b/src/components/sections/compensation-calculator/CompensationCalculator.tsx @@ -71,10 +71,10 @@ export default async function CompensationCalculator({ )}