hensei-web/utils/getElementForParty.tsx
Justin Edmund 5cf6d3fff3 Refactor [party] page
This is a blueprint for all the other pages
2023-01-28 17:20:44 -08:00

8 lines
258 B
TypeScript

export default function getElementForParty(party: Party) {
const mainhand = party.weapons.find((weapon) => weapon.mainhand)
if (mainhand && mainhand.object.element === 0) {
return mainhand.element
} else {
return mainhand?.object.element
}
}