fix(admin): use useTranslation hook in client components
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Build #6 failed because client components were trying to receive translations as props from server components, which breaks Next.js serialization boundaries. Fix: Use useTranslation() hook directly in client components to access translations context, matching the pattern used in consumer app. Changes: - AdminClubsList: Remove locale/t props, use useTranslation() hook - AdminClubDetail: Remove locale/t props, use useTranslation() hook - Simplified page.tsx wrappers to not pass translations This matches the consumer app pattern and allows proper SSR/client component boundaries.master
parent
9f47dab8d8
commit
4df827bce6
@ -1,15 +1,12 @@
|
||||
import { Locale } from '@/i18n-config';
|
||||
import { getTranslate } from '../../../dictionaries';
|
||||
import AdminClubDetailComponent from './AdminClubDetail';
|
||||
|
||||
export default async function AdminClubDetailPage({
|
||||
params
|
||||
}: {
|
||||
params: Promise<{ locale: Locale; club_id: string }>
|
||||
params: Promise<{ club_id: string }>
|
||||
}) {
|
||||
const { locale, club_id } = await params;
|
||||
const {t} = await getTranslate(locale);
|
||||
const { club_id } = await params;
|
||||
const clubId = parseInt(club_id, 10);
|
||||
|
||||
return <AdminClubDetailComponent clubId={clubId} locale={locale} t={t} />;
|
||||
return <AdminClubDetailComponent clubId={clubId} />;
|
||||
}
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
import { Locale } from '@/i18n-config';
|
||||
import { getTranslate } from '../../dictionaries';
|
||||
import AdminClubsList from './AdminClubsList';
|
||||
|
||||
export default async function AdminClubsPage({ params }: { params: Promise<{ locale: Locale }>}) {
|
||||
const { locale } = await params;
|
||||
const {t} = await getTranslate(locale);
|
||||
|
||||
return <AdminClubsList locale={locale} t={t} />;
|
||||
export default async function AdminClubsPage() {
|
||||
return <AdminClubsList />;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue