540b6290c4
- Integrated multi-language functionality across the audit log, system notices, collection management, and common code management components, enhancing accessibility for diverse users. - Updated UI elements to utilize translation keys, ensuring that all text is dynamically translated based on user preferences. - Improved error handling messages to be localized, providing a better user experience in case of issues. These changes significantly enhance the usability and internationalization of the management features, making the application more inclusive.
72 lines
2.6 KiB
TypeScript
72 lines
2.6 KiB
TypeScript
"use client";
|
|
|
|
import { CodeCategoryPanel } from "@/components/admin/CodeCategoryPanel";
|
|
import { CodeDetailPanel } from "@/components/admin/CodeDetailPanel";
|
|
import { useSelectedCategory } from "@/hooks/useSelectedCategory";
|
|
import { ScrollToTop } from "@/components/common/ScrollToTop";
|
|
import { usePageMultiLang } from "@/hooks/usePageMultiLang";
|
|
|
|
// 다국어 키 목록
|
|
const LANG_KEYS = [
|
|
"commonCode.page.title",
|
|
"commonCode.page.description",
|
|
"commonCode.category.title",
|
|
"commonCode.detail.title",
|
|
] as const;
|
|
|
|
// 한국어 기본 텍스트
|
|
const DEFAULT_TEXTS: Record<string, string> = {
|
|
"commonCode.page.title": "공통코드 관리",
|
|
"commonCode.page.description": "시스템에서 사용하는 공통코드를 관리합니다",
|
|
"commonCode.category.title": "코드 카테고리",
|
|
"commonCode.detail.title": "코드 상세 정보",
|
|
};
|
|
|
|
export default function CommonCodeManagementPage() {
|
|
const { t } = usePageMultiLang({
|
|
keys: LANG_KEYS,
|
|
defaults: DEFAULT_TEXTS,
|
|
menuCode: "admin.systemMng.commonCode",
|
|
});
|
|
const { selectedCategoryCode, selectCategory } = useSelectedCategory();
|
|
|
|
return (
|
|
<div className="flex min-h-screen flex-col bg-background">
|
|
<div className="space-y-6 p-6">
|
|
{/* 페이지 헤더 */}
|
|
<div className="space-y-2 border-b pb-4">
|
|
<h1 className="text-3xl font-bold tracking-tight">{t("commonCode.page.title")}</h1>
|
|
<p className="text-sm text-muted-foreground">{t("commonCode.page.description")}</p>
|
|
</div>
|
|
|
|
{/* 메인 콘텐츠 - 좌우 레이아웃 */}
|
|
<div className="flex flex-col gap-6 lg:flex-row lg:gap-6">
|
|
{/* 좌측: 카테고리 패널 */}
|
|
<div className="w-full lg:w-80 lg:border-r lg:pr-6">
|
|
<div className="space-y-4">
|
|
<h2 className="text-lg font-semibold">{t("commonCode.category.title")}</h2>
|
|
<CodeCategoryPanel selectedCategoryCode={selectedCategoryCode} onSelectCategory={selectCategory} />
|
|
</div>
|
|
</div>
|
|
|
|
{/* 우측: 코드 상세 패널 */}
|
|
<div className="min-w-0 flex-1 lg:pl-0">
|
|
<div className="space-y-4">
|
|
<h2 className="text-lg font-semibold">
|
|
{t("commonCode.detail.title")}
|
|
{selectedCategoryCode && (
|
|
<span className="ml-2 text-sm font-normal text-muted-foreground">({selectedCategoryCode})</span>
|
|
)}
|
|
</h2>
|
|
<CodeDetailPanel categoryCode={selectedCategoryCode} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Scroll to Top 버튼 */}
|
|
<ScrollToTop />
|
|
</div>
|
|
);
|
|
}
|