- Move all App Router pages under [locale] dynamic segment - Update layout to handle locale params and server-side version fetch - Remove duplicate pages from root app directory - Add generateStaticParams for static generation of locale routes - Update Header component for locale-aware navigation - Update about page to use next-intl hooks 🤖 Generated with Claude Code https://claude.ai/code Co-Authored-By: Claude <noreply@anthropic.com>
74 lines
1.7 KiB
TypeScript
74 lines
1.7 KiB
TypeScript
'use client'
|
|
|
|
import React, { useEffect, useState } from 'react'
|
|
import { useTranslations } from 'next-intl'
|
|
import { useRouter } from '~/i18n/navigation'
|
|
|
|
// Utils
|
|
import { appState } from '~/utils/appState'
|
|
import { GridType } from '~/utils/enums'
|
|
|
|
// Components
|
|
import Party from '~/components/party/Party'
|
|
import PartyFooter from '~/components/party/PartyFooter'
|
|
import ErrorSection from '~/components/ErrorSection'
|
|
|
|
interface Props {
|
|
party: any; // Replace with proper Party type
|
|
raidGroups: any[]; // Replace with proper RaidGroup type
|
|
}
|
|
|
|
const PartyPageClient: React.FC<Props> = ({ party, raidGroups }) => {
|
|
const router = useRouter()
|
|
const t = useTranslations('common')
|
|
|
|
// State for tab management
|
|
const [selectedTab, setSelectedTab] = useState<GridType>(GridType.Weapon)
|
|
|
|
// Initialize app state
|
|
useEffect(() => {
|
|
if (party) {
|
|
appState.parties[0] = party
|
|
appState.raidGroups = raidGroups
|
|
}
|
|
}, [party, raidGroups])
|
|
|
|
// Handle tab change
|
|
const handleTabChanged = (value: string) => {
|
|
const tabType = parseInt(value) as GridType
|
|
setSelectedTab(tabType)
|
|
}
|
|
|
|
// Navigation helper (not used for existing parties but required by interface)
|
|
const pushHistory = (path: string) => {
|
|
router.push(path)
|
|
}
|
|
|
|
|
|
// Error case
|
|
if (!party) {
|
|
return (
|
|
<ErrorSection
|
|
status={{
|
|
code: 404,
|
|
text: 'not_found'
|
|
}}
|
|
/>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Party
|
|
team={party}
|
|
selectedTab={selectedTab}
|
|
raidGroups={raidGroups}
|
|
handleTabChanged={handleTabChanged}
|
|
pushHistory={pushHistory}
|
|
/>
|
|
<PartyFooter party={party} />
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default PartyPageClient
|