Replace hardcoded Korean text '자주 묻는 질문' with dynamic
translation key using useTranslation hook.
Changes:
- Import useTranslation from react-i18next
- Replace hardcoded title with t('support.faq.title')
- Maintains consistency with FAQ list page localization
Note: FAQ list-page.tsx was already fully localized.
Translation key 'support.faq.title' already exists in en.json.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { useEffect, useState } from 'react';
|
|
import { PATHS } from '@/shared/constants/paths';
|
|
import { useLocation } from 'react-router';
|
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
import { HeaderType } from '@/entities/common/model/types';
|
|
import { useTranslation } from 'react-i18next';
|
|
import {
|
|
useSetHeaderTitle,
|
|
useSetHeaderType,
|
|
useSetFooterMode,
|
|
useSetOnBack
|
|
} from '@/widgets/sub-layout/use-sub-layout';
|
|
|
|
export const FaqDetailPage = () => {
|
|
const { navigate } = useNavigate();
|
|
const location = useLocation();
|
|
const { t } = useTranslation();
|
|
|
|
const [cursorId, setCursorId] = useState<number>(0);
|
|
const [seq, setSeq] = useState<string>('');
|
|
const [category, setCategory] = useState<string>('');
|
|
const [title, setTitle] = useState<string>('');
|
|
const [contents, setContents] = useState<string>('');
|
|
|
|
useSetHeaderTitle(t('support.faq.title'));
|
|
useSetHeaderType(HeaderType.LeftArrow);
|
|
useSetFooterMode(false);
|
|
useSetOnBack(() => {
|
|
navigate(PATHS.support.faq.list);
|
|
});
|
|
|
|
useEffect(() => {
|
|
setCursorId(location?.state.cursorId);
|
|
setSeq(location?.state.seq);
|
|
setCategory(location?.state.category);
|
|
setTitle(location?.state.title);
|
|
setContents(location?.state.contents);
|
|
}, []);
|
|
return (
|
|
<>
|
|
<main>
|
|
{ contents &&
|
|
<div className="tab-content">
|
|
<div className="tab-pane sub active">
|
|
<div className="faq-detail">
|
|
<div className="faq-detail__title">{ title }</div>
|
|
<div className="faq-detail__divider"></div>
|
|
<div className="faq-detail__body" dangerouslySetInnerHTML={{ __html: contents || '' }}></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</main>
|
|
</>
|
|
);
|
|
}; |