3
3
import { FC } from "react" ;
4
4
import Link from "next/link" ;
5
5
import Container from "@/components/Container" ;
6
+ import { VersionDifferent } from "@/enum" ;
6
7
import { useSuspenseQuery } from "@tanstack/react-query" ;
7
8
import { historyQuery } from "@/services/history/history.query" ;
8
9
import * as styles from "./style.css" ;
@@ -21,33 +22,33 @@ const HistoryDetail: FC<{ id: number; title: string }> = ({ id, title }) => {
21
22
docsType = { history . docsType }
22
23
lastModifiedAt = { history . versionDocs . thisVersionCreatedAt }
23
24
>
24
- < div className = { styles . container } >
25
+ < main className = { styles . container } >
25
26
< Link href = { `/user/${ history . versionDocs . userId } ` } className = { styles . author } >
26
27
작성자 · { history . versionDocs . nickName }
27
28
</ Link >
28
- < div className = { styles . historyBox } >
29
+ < ul className = { styles . historyBox } >
29
30
{ history . diff . map ( ( dif : HistoryType , historyId : number ) => {
30
31
const operationIcon = ( ( ) => {
31
32
switch ( dif . operation ) {
32
- case " INSERT" :
33
+ case VersionDifferent . INSERT :
33
34
return "+" ;
34
- case " DELETE" :
35
+ case VersionDifferent . DELETE :
35
36
return "-" ;
36
- case " EQUAL" :
37
- return "" ;
37
+ case VersionDifferent . EQUAL :
38
+ return ;
38
39
default :
39
40
return dif . operation ;
40
41
}
41
42
} ) ( ) ;
42
43
return (
43
- < div key = { historyId } className = { styles . historyContent } >
44
- < div className = { styles . historyOperation [ dif . operation ] } > { operationIcon } </ div >
45
- < div className = { styles . history [ dif . operation ] } > { dif . text } </ div >
46
- </ div >
44
+ < li key = { historyId } className = { styles . historyContent } >
45
+ < i className = { styles . historyOperation [ dif . operation ] } > { operationIcon } </ i >
46
+ < p className = { styles . history [ dif . operation ] } > { dif . text } </ p >
47
+ </ li >
47
48
) ;
48
49
} ) }
49
- </ div >
50
- </ div >
50
+ </ ul >
51
+ </ main >
51
52
</ Container >
52
53
) ;
53
54
} ;
0 commit comments