File tree Expand file tree Collapse file tree 1 file changed +6
-16
lines changed
src/features/localization/services Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -4,27 +4,17 @@ import React from "react";
4
4
5
5
import EnIntroduction from "@/features/introduction/docs/en.introduction.mdx" ;
6
6
import JaIntroduction from "@/features/introduction/docs/ja.introduction.mdx" ;
7
+ import { getIntroductionDictionary } from "./language-dictionary.service" ;
7
8
8
9
interface GetIntroductionContentParams {
9
10
languageCode : string ;
10
11
}
11
12
12
- interface GetIntroductionContentResult {
13
- Component : React . FC ;
14
- }
15
-
16
13
export const getIntroductionContent = (
17
- params : GetIntroductionContentParams ,
18
- ) : GetIntroductionContentResult => {
14
+ params : GetIntroductionContentParams
15
+ ) => {
19
16
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 } /> ;
30
20
} ;
You can’t perform that action at this time.
0 commit comments