)
}
}
function opusImage(index: number) {
const baseUrl = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-keys/`
// If there is a grid weapon, it is a Dark Opus Weapon and it has keys
if (props.gridWeapon.object.series === 2 && props.gridWeapon.weapon_keys) {
const weaponKey = props.gridWeapon.weapon_keys[index]
const altText = weaponKey.name[locale]
let filename = weaponKey.slug
if (weaponKey.slot === 1) {
const element = props.gridWeapon.object.element
const mod = props.gridWeapon.object.name.en.includes('Repudiation')
? 'primal'
: 'magna'
const suffixes = [
'pendulum-strength',
'pendulum-zeal',
'pendulum-strife',
'chain-temperament',
'chain-restoration',
'chain-glorification',
]
if (suffixes.includes(weaponKey.slug)) {
filename += `-${mod}-${element}`
}
}
return (
)
}
}
function ultimaImage(index: number) {
const baseUrl = `${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/weapon-keys/`
// If there is a grid weapon, it is a Dark Opus Weapon and it has keys
if (props.gridWeapon.object.series === 17 && props.gridWeapon.weapon_keys) {
const weaponKey = props.gridWeapon.weapon_keys[index]
const altText = weaponKey.name[locale]
let filename = weaponKey.slug
if (weaponKey.slot === 0) {
filename += `-${props.gridWeapon.object.proficiency}`
}
return (
)
}
}
const createPrimaryAxSkillString = () => {
const primaryAxSkills = ax[props.gridWeapon.object.ax_type - 1]
if (props.gridWeapon.ax) {
const simpleAxSkill = props.gridWeapon.ax[0]
const axSkill = primaryAxSkills.find(
(skill) => skill.id == simpleAxSkill.modifier
)
return `${axSkill?.name[locale]} +${simpleAxSkill.strength}${
axSkill?.suffix ? axSkill.suffix : ''
}`
}
return ''
}
const createSecondaryAxSkillString = () => {
const primaryAxSkills = ax[props.gridWeapon.object.ax_type - 1]
if (props.gridWeapon.ax) {
const primarySimpleAxSkill = props.gridWeapon.ax[0]
const secondarySimpleAxSkill = props.gridWeapon.ax[1]
const primaryAxSkill = primaryAxSkills.find(
(skill) => skill.id == primarySimpleAxSkill.modifier
)
if (primaryAxSkill && primaryAxSkill.secondary) {
const secondaryAxSkill = primaryAxSkill.secondary.find(
(skill) => skill.id == secondarySimpleAxSkill.modifier
)
return `${secondaryAxSkill?.name[locale]} +${
secondarySimpleAxSkill.strength
}${secondaryAxSkill?.suffix ? secondaryAxSkill.suffix : ''}`
}
}
return ''
}
const awakeningSection = (
{`${props.gridWeapon.awakening?.type.name[locale]}`}
{`Lv${props.gridWeapon.awakening?.level}`}