- Add 'use client' directives to all remaining components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')
- Update LanguageSwitch to use router.refresh()
- Replace router.asPath with usePathname()
Components migrated:
- Common: SelectWithInput, Editor
- Layout: Header, Layout, MentionList, ElementToggle
- Misc: UpdateToast, SearchModal, RaidCombobox, FilterModal
- Misc: ChangelogUnit, HovercardHeader, LanguageSwitch
- Extra: GuidebookUnit, GuidebookResult
- Reps: GridRep, CharacterRep, WeaponRep, SummonRep
Added migration PRD documentation to track progress.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
738 B
TypeScript
31 lines
738 B
TypeScript
'use client'
|
|
import React from 'react'
|
|
import { getCookie } from 'cookies-next'
|
|
|
|
import styles from './index.module.scss'
|
|
|
|
interface Props {
|
|
data: Guidebook
|
|
onClick: () => void
|
|
}
|
|
|
|
const GuidebookResult = (props: Props) => {
|
|
const locale = (getCookie('NEXT_LOCALE') as string) || 'en'
|
|
|
|
const guidebook = props.data
|
|
|
|
return (
|
|
<li className={styles.result} onClick={props.onClick}>
|
|
<img
|
|
alt={guidebook.name[locale]}
|
|
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/guidebooks/book_${guidebook.granblue_id}.png`}
|
|
/>
|
|
<div className={styles.info}>
|
|
<h5>{guidebook.name[locale]}</h5>
|
|
<p>{guidebook.description[locale]}</p>
|
|
</div>
|
|
</li>
|
|
)
|
|
}
|
|
|
|
export default GuidebookResult
|