1
- import { CautionIssue , DangerIssue , PassableStatus } from "../../constant/enum/reportEnum" ;
1
+ import { IssueTypeKey , PassableStatus } from "../../constant/enum/reportEnum" ;
2
2
import { IssueQuestionButtons , ReportFormData , ReportModeType } from "../../data/types/report" ;
3
3
4
4
import { FormTitle } from "./formTitle" ;
5
5
import { SecondaryFormButton } from "./secondaryButton" ;
6
6
7
7
const buttonConfig = {
8
- danger : [ DangerIssue . CURB , DangerIssue . CRACK , DangerIssue . SLOPE , DangerIssue . ETC ] ,
9
- caution : [
10
- CautionIssue . CURB ,
11
- CautionIssue . STAIRS ,
12
- CautionIssue . SLOPE ,
13
- CautionIssue . ETC ,
14
- ] ,
8
+ danger : [ IssueTypeKey . CURB , IssueTypeKey . STAIRS , IssueTypeKey . SLOPE , IssueTypeKey . ETC ] ,
9
+ caution : [ IssueTypeKey . CURB , IssueTypeKey . CRACK , IssueTypeKey . SLOPE , IssueTypeKey . ETC ] ,
15
10
} as IssueQuestionButtons ;
16
11
17
12
type SecondaryFormProps = {
18
13
reportMode : ReportModeType ;
19
14
formData : ReportFormData ;
20
- handleSecondarySelect : ( answer : DangerIssue | CautionIssue ) => void ;
15
+ handleSecondarySelect : ( answer : IssueTypeKey ) => void ;
21
16
} ;
22
17
23
18
export const SecondaryForm = ( { formData, handleSecondarySelect, reportMode } : SecondaryFormProps ) => {
@@ -35,8 +30,7 @@ export const SecondaryForm = ({ formData, handleSecondarySelect, reportMode }: S
35
30
onClick = { handleSecondarySelect }
36
31
formPassableStatus = { formData . passableStatus }
37
32
isSelected = { formData . cautionIssues . includes ( button ) }
38
- content = { button }
39
- key = { index }
33
+ contentKey = { button }
40
34
/>
41
35
) ;
42
36
} ) }
@@ -47,8 +41,7 @@ export const SecondaryForm = ({ formData, handleSecondarySelect, reportMode }: S
47
41
onClick = { handleSecondarySelect }
48
42
formPassableStatus = { formData . passableStatus }
49
43
isSelected = { formData . dangerIssues . includes ( button ) }
50
- content = { button }
51
- key = { index }
44
+ contentKey = { button }
52
45
/>
53
46
) ;
54
47
} ) }
0 commit comments