hensei-web/components/extra/GuidebooksGrid/index.tsx
Justin Edmund b34cc8a4eb refactor: migrate all components from next-i18next to next-intl
- Update all component imports from useTranslation to useTranslations
- Replace react-i18next and next-i18next imports with next-intl
- Convert Trans components to t.rich() for rich text formatting
- Update all translation hook usage to next-intl API

This affects 80+ component files across the codebase including:
- Character, weapon, summon components
- Auth modals (login, signup, account)
- Party management components
- Filter and search components
- Toast notifications
- About pages and content updates

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:48:04 -07:00

61 lines
1.4 KiB
TypeScript

import React from 'react'
import { useTranslations } from 'next-intl'
import classNames from 'classnames'
import GuidebookUnit from '../GuidebookUnit'
import type { SearchableObject } from '~types'
import styles from './index.module.scss'
// Props
interface Props {
grid: GuidebookList
editable: boolean
removeGuidebook: (position: number) => void
updateObject: (object: SearchableObject, position: number) => void
}
// Constants
const EXTRA_WEAPONS_COUNT = 3
const GuidebooksGrid = ({
grid,
editable,
removeGuidebook,
updateObject,
}: Props) => {
const t = useTranslations('common')
const classes = classNames({
[styles.guidebooks]: true,
[styles.containerItem]: true,
})
const guidebooks = (
<ul className={styles.grid}>
{Array.from(Array(EXTRA_WEAPONS_COUNT)).map((x, i) => {
const itemClasses = classNames({
Empty: grid && grid[i] === undefined,
})
return (
<li className={itemClasses} key={`grid_unit_${i}`}>
<GuidebookUnit
editable={editable}
position={i + 1}
guidebook={grid[i + 1]}
removeGuidebook={removeGuidebook}
updateObject={updateObject}
/>
</li>
)
})}
</ul>
)
const guidebookElement = <div className={classes}>{guidebooks}</div>
return guidebookElement
}
export default GuidebooksGrid