- Add 'use client' directives to all job and mastery components
- Update imports from next/router to next/navigation
- Replace router.locale with getCookie('NEXT_LOCALE')
Job components migrated:
- JobSkillItem, JobSection, JobDropdown, JobAccessoryPopover
- JobAccessoryItem, JobSkillResult, JobImage
Mastery components migrated:
- ExtendedMasterySelect, AxSelect, AwakeningSelectWithInput
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
802 B
TypeScript
33 lines
802 B
TypeScript
'use client'
|
|
import React from 'react'
|
|
import { getCookie } from 'cookies-next'
|
|
|
|
import * as RadioGroup from '@radix-ui/react-radio-group'
|
|
|
|
import styles from './index.module.scss'
|
|
|
|
interface Props {
|
|
accessory: JobAccessory
|
|
selected: boolean
|
|
}
|
|
|
|
const JobAccessoryItem = ({ accessory, selected }: Props) => {
|
|
// Localization
|
|
const locale = (getCookie('NEXT_LOCALE') as string) || 'en'
|
|
|
|
return (
|
|
<RadioGroup.Item
|
|
className={styles.item}
|
|
data-state={selected ? 'checked' : 'unchecked'}
|
|
value={accessory.id}
|
|
>
|
|
<img
|
|
alt={accessory.name[locale]}
|
|
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/accessory-grid/${accessory.granblue_id}.jpg`}
|
|
/>
|
|
<h4>{accessory.name[locale]}</h4>
|
|
</RadioGroup.Item>
|
|
)
|
|
}
|
|
|
|
export default JobAccessoryItem
|