hensei-web/components/extra/ExtraSummonsGrid/index.tsx
Justin Edmund 3d67622353
Fix i18n migration to next-intl (#430)
## Summary
- Fixed translation key format compatibility with next-intl
- Fixed pluralization format from i18next to next-intl format
- Fixed dynamic translation key error handling
- Updated server components to match API response structure
- Fixed useSearchParams import location

## Changes
- Changed pluralization from `{{count}} items` to `{count} items` format
- Added proper error handling for missing translation keys
- Fixed import paths for next-intl hooks
- Fixed PartyPageClient trying to set non-existent appState.parties

## Test plan
- [x] Verified translations render correctly
- [x] Tested pluralization works with different counts
- [x] Confirmed no console errors about missing translations
- [x] Tested party page functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-03 16:25:59 -07:00

50 lines
1.4 KiB
TypeScript

import React from 'react'
import { useTranslations } from 'next-intl'
import SummonUnit from '~components/summon/SummonUnit'
import { SearchableObject } from '~types'
import styles from './index.module.scss'
// Props
interface Props {
grid: GridArray<GridSummon>
editable: boolean
exists: boolean
found?: boolean
offset: number
removeSummon: (id: string) => void
updateObject: (object: SearchableObject, position: number) => void
updateUncap: (id: string, position: number, uncap: number) => void
updateTranscendence: (id: string, position: number, stage: number) => void
}
const ExtraSummonsGrid = (props: Props) => {
const numSummons: number = 2
const t = useTranslations('common')
return (
<div className={styles.container}>
<h3>{t('summons.subaura')}</h3>
<ul className={styles.grid}>
{Array.from(Array(numSummons)).map((x, i) => {
return (
<li key={`grid_unit_${i}`}>
<SummonUnit
editable={props.editable}
position={props.offset + i}
unitType={1}
removeSummon={props.removeSummon}
gridSummon={props.grid[props.offset + i]}
updateObject={props.updateObject}
updateUncap={props.updateUncap}
updateTranscendence={props.updateTranscendence}
/>
</li>
)
})}
</ul>
</div>
)
}
export default ExtraSummonsGrid