diff --git a/src/components/AmbassadorCard.tsx b/src/components/AmbassadorCard.tsx
index eb292b2..75799f1 100644
--- a/src/components/AmbassadorCard.tsx
+++ b/src/components/AmbassadorCard.tsx
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, type Ref } from "react";
import type { CreateTypes } from "canvas-confetti";
import Confetti from "react-canvas-confetti";
+import { getSpecies } from "../../../data/src/ambassadors/species";
import { calculateAge, formatDate, isBirthday } from "../utils/dateManager";
import { useAmbassador } from "../hooks/useAmbassadors";
import { camelToKebab } from "../utils/helpers";
@@ -119,6 +120,8 @@ export default function AmbassadorCard(props: AmbassadorCardProps) {
if (!ambassador) return null;
+ const species = getSpecies(ambassador.species);
+
return (
<>
{birthday &&
{ambassador.species}
+{species.name}
- {ambassador.scientific}{" "} + {species.scientificName}{" "} ({ambassador.class.title}) @@ -252,20 +255,20 @@ export default function AmbassadorCard(props: AmbassadorCardProps) {
{ambassador.native.text}
+{species.native.text}
Wild:{" "} - {"wild" in ambassador.lifespan && - ambassador.lifespan.wild !== undefined ? ( + {"wild" in species.lifespan && + species.lifespan.wild !== undefined ? ( <> ~ - {stringifyLifespan(ambassador.lifespan.wild)} years + {stringifyLifespan(species.lifespan.wild)} years > ) : ( "Unknown" @@ -273,13 +276,13 @@ export default function AmbassadorCard(props: AmbassadorCardProps) {
Captivity:{" "}
- {"captivity" in ambassador.lifespan &&
- ambassador.lifespan.captivity !== undefined ? (
+ {"captivity" in species.lifespan &&
+ species.lifespan.captivity !== undefined ? (
<>
~
- {stringifyLifespan(ambassador.lifespan.captivity)} years
+ {stringifyLifespan(species.lifespan.captivity)} years
>
) : (
"Unknown"
diff --git a/src/hooks/useAmbassadors.tsx b/src/hooks/useAmbassadors.tsx
index bb0011e..4b19fce 100644
--- a/src/hooks/useAmbassadors.tsx
+++ b/src/hooks/useAmbassadors.tsx
@@ -10,14 +10,18 @@ import { z } from "zod";
import allAmbassadors, {
ambassadorSchema,
-} from "@alveusgg/data/src/ambassadors/core";
-import { isActiveAmbassadorEntry } from "@alveusgg/data/src/ambassadors/filters";
-import { getClassification } from "@alveusgg/data/src/ambassadors/classification";
+} from "../../../data/src/ambassadors/core";
+import { isActiveAmbassadorEntry } from "../../../data/src/ambassadors/filters";
+import { getClassification } from "../../../data/src/ambassadors/classification";
import {
getAmbassadorImages,
ambassadorImageSchema,
-} from "@alveusgg/data/src/ambassadors/images";
-import { getIUCNStatus } from "@alveusgg/data/src/iucn";
+} from "../../../data/src/ambassadors/images";
+import { getIUCNStatus } from "../../../data/src/iucn";
+import {
+ getSpecies,
+ speciesSchema,
+} from "../../../data/src/ambassadors/species";
import {
typeSafeObjectEntries,
@@ -29,7 +33,7 @@ import winstonImage from "../assets/winston.png";
// These schema should match the type exposed by the API
const apiAmbassadorSchema = ambassadorSchema.extend({
image: ambassadorImageSchema,
- iucn: ambassadorSchema.shape.iucn.extend({
+ iucn: speciesSchema.shape.iucn.extend({
title: z.string(),
}),
class: z.object({
@@ -65,6 +69,7 @@ const fallbackAmbassadors: Record