@@ -10,8 +10,10 @@ import { DefaultLogo } from "@/components/common/logo";
1010import { useAppDispatch , useAppSelector } from "@/hooks/reduxHook" ;
1111import { setResetPost } from "@/store/modules/post" ;
1212import { deletePost , postPost , putPost } from "@/app/api/posts" ;
13+ import { useTranslation } from "@/hooks/useTranslation" ;
1314
1415const PostsHeader = ( ) => {
16+ const { t } = useTranslation ( ) ;
1517 const dispatch = useAppDispatch ( ) ;
1618 const user = useAppSelector ( ( state ) => state . user ) ;
1719 const { title, markdownValue } = useAppSelector ( ( state ) => state . post ) ;
@@ -53,8 +55,8 @@ const PostsHeader = () => {
5355 < header className = { styles . header } >
5456 < nav className = { styles . nav } >
5557 < DefaultLogo size = "small" withText />
56- { isPosts && isAdmin && < Link href = "/posts/create" > CREATE </ Link > }
57- { ! isPosts && < Link href = "/posts" > POST </ Link > }
58+ { isPosts && isAdmin && < Link href = "/posts/create" > { t ( "posts.create" ) . toUpperCase ( ) } </ Link > }
59+ { ! isPosts && < Link href = "/posts" > { t ( "posts.navPost" ) . toUpperCase ( ) } </ Link > }
5860 </ nav >
5961
6062 { isAdmin && ! isPosts && (
@@ -71,7 +73,7 @@ const PostsHeader = () => {
7173 }
7274 disabled = { loading }
7375 >
74- { isEdit ? " save" : " create"}
76+ { isEdit ? t ( "common. save") : t ( "common. create") }
7577 </ button >
7678 < Link
7779 href = { isEdit ? `/posts/${ index } ` : "/posts" }
@@ -80,7 +82,7 @@ const PostsHeader = () => {
8082 } `}
8183 onClick = { ( ) => handleButton ( "cancel" ) }
8284 >
83- cancel
85+ { t ( "common. cancel" ) }
8486 </ Link >
8587 </ >
8688 ) : (
@@ -91,7 +93,7 @@ const PostsHeader = () => {
9193 loading && styles . loading
9294 } `}
9395 >
94- edit
96+ { t ( "common. edit" ) }
9597 </ Link >
9698 < button
9799 type = "button"
@@ -101,7 +103,7 @@ const PostsHeader = () => {
101103 onClick = { ( ) => handleButton ( "delete" ) }
102104 disabled = { loading }
103105 >
104- delete
106+ { t ( "common. delete" ) }
105107 </ button >
106108 </ >
107109 ) }
0 commit comments