Skip to content

Commit 006aa10

Browse files
committed
refactor ui language content service
1 parent b609af7 commit 006aa10

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

src/features/localization/services/ui-language-content.service.tsx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,17 @@ import React from "react";
44

55
import EnIntroduction from "@/features/introduction/docs/en.introduction.mdx";
66
import JaIntroduction from "@/features/introduction/docs/ja.introduction.mdx";
7+
import { getIntroductionDictionary } from "./language-dictionary.service";
78

89
interface GetIntroductionContentParams {
910
languageCode: string;
1011
}
1112

12-
interface GetIntroductionContentResult {
13-
Component: React.FC;
14-
}
15-
1613
export const getIntroductionContent = (
17-
params: GetIntroductionContentParams,
18-
): GetIntroductionContentResult => {
14+
params: GetIntroductionContentParams
15+
) => {
1916
const { languageCode } = params;
20-
21-
if (languageCode === "ja") {
22-
return {
23-
Component: JaIntroduction,
24-
};
25-
}
26-
27-
return {
28-
Component: EnIntroduction,
29-
};
17+
const introductionDictionary = getIntroductionDictionary(languageCode)
18+
const headings = introductionDictionary.content.headings
19+
return languageCode === "ja" ? <JaIntroduction headings={headings}/> : <EnIntroduction headings={headings}/>;
3020
};

0 commit comments

Comments
 (0)