diff --git a/src/goals/MergeDuplicates/MergeDupsStep/SenseCardContent.tsx b/src/goals/MergeDuplicates/MergeDupsStep/SenseCardContent.tsx index 255684ab80..252e431053 100644 --- a/src/goals/MergeDuplicates/MergeDupsStep/SenseCardContent.tsx +++ b/src/goals/MergeDuplicates/MergeDupsStep/SenseCardContent.tsx @@ -14,6 +14,7 @@ import { IconButtonWithTooltip, PartOfSpeechButton } from "components/Buttons"; import MultilineTooltipTitle from "components/MultilineTooltipTitle"; import DomainChipsGrid from "components/WordCard/DomainChipsGrid"; import SenseCardText from "components/WordCard/SenseCardText"; +import { combineSenses } from "goals/MergeDuplicates/Redux/reducerUtilities"; interface SenseCardContentProps { senses: Sense[]; @@ -31,13 +32,14 @@ export default function SenseCardContent( ): ReactElement { const { t } = useTranslation(); - const gramInfo = props.senses - .map((s) => s.grammaticalInfo) - .find((g) => g.catGroup !== GramCatGroup.Unspecified); - - const semDoms = props.senses - .flatMap((s) => s.semanticDomains) - .sort((a, b) => a.id.localeCompare(b.id)); + const sense = combineSenses(props.senses); + const gramInfo = + sense.grammaticalInfo.catGroup === GramCatGroup.Unspecified + ? undefined + : sense.grammaticalInfo; + const semDoms = sense.semanticDomains.sort((a, b) => + a.id.localeCompare(b.id) + ); const reasonText = (reason: ProtectReason): string => { // Backend/Helper/LiftHelper.cs > GetProtectedReasons(LiftSense sense) @@ -96,9 +98,9 @@ export default function SenseCardContent( }; const protectedWarning = - !props.sidebar && props.senses[0].accessibility === Status.Protected; + !props.sidebar && sense.accessibility === Status.Protected; const tooltipTexts = [t("mergeDups.helpText.protectedSense")]; - const reasons = props.senses[0]?.protectReasons; + const reasons = sense.protectReasons; if (reasons?.length) { tooltipTexts.push( t("mergeDups.helpText.protectedData", { @@ -114,7 +116,7 @@ export default function SenseCardContent(