Skip to content

Commit

Permalink
chore: remove "no_compensation_data"
Browse files Browse the repository at this point in the history
We filter it now, so this shouldn't occur
  • Loading branch information
trulshj committed Dec 16, 2024
1 parent 52acdca commit b4415d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
3 changes: 1 addition & 2 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"degreeOptions": {
"bachelor": "Bachelor",
"master": "Master"
},
"no_compensation_data": "Whoops, the accounts seem to be on holiday. {city}, huh..."
}
},
"employee_card": {
"show": "Showing",
Expand Down
3 changes: 1 addition & 2 deletions messages/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"bachelor": "Bachelor",
"master": "Master"
},
"test": "test",
"no_compensation_data": "Woops, regnskapet er på avveie. {city} altså..."
"test": "test"
},
"custom_link": {
"visit_cv": "Gå til mini-CV",
Expand Down
3 changes: 1 addition & 2 deletions messages/se.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
"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",
Expand Down
15 changes: 1 addition & 14 deletions src/components/compensations/CompensationSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
import { useTranslations } from "next-intl";
import { useState } from "react";

import {
Expand All @@ -25,8 +24,6 @@ export default function CompensationSelector({
locations,
locale,
}: CompensationsProps) {
const t = useTranslations("compensation_calculator");

const hasBenefits = (id: string) =>
compensations.benefitsByLocation.some((b) => b.location._ref === id);

Expand All @@ -40,9 +37,6 @@ export default function CompensationSelector({
const [selectedLocation, setSelectedLocation] = useState<string>(
locationOptions[0]?.id,
);
const [selectedLocationLabel, setSelectedLocationLabel] = useState<string>(
locationOptions[0]?.label,
);

const benefitsFilteredByLocation =
compensations.benefitsByLocation.find(
Expand All @@ -62,20 +56,13 @@ export default function CompensationSelector({
selectedId={selectedLocation}
onValueChange={(option) => {
setSelectedLocation(option.id);
setSelectedLocationLabel(option.label);
}}
/>

{yearlyBonusesForLocation && (
<YearlyBonuses bonuses={yearlyBonusesForLocation} locale={locale} />
)}
{benefitsFilteredByLocation.length > 0 ? (
<BenefitsByLocation benefits={benefitsFilteredByLocation} />
) : (
<span>
{t("no_compensation_data", { city: selectedLocationLabel })}
</span>
)}
<BenefitsByLocation benefits={benefitsFilteredByLocation} />
</div>
);
}

0 comments on commit b4415d5

Please sign in to comment.