File tree Expand file tree Collapse file tree 1 file changed +22
-14
lines changed
frontend/components/questions Expand file tree Collapse file tree 1 file changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -96,20 +96,28 @@ const QuestionFormModal: React.FC<QuestionFormModalProps> = ({ ...props }) => {
96
96
</ DialogHeader >
97
97
< div >
98
98
< Label > Category</ Label >
99
- < MultiSelect
100
- className = "mt-2"
101
- defaultValue = { question . categories as string [ ] }
102
- options = { CategoryEnumArray . map ( ( category ) => ( {
103
- label : category ,
104
- value : category ,
105
- } ) ) }
106
- onValueChange = { ( v ) =>
107
- setQuestion ( {
108
- ...question ,
109
- categories : v as CategoryEnum [ ] ,
110
- } )
111
- }
112
- />
99
+ { props . isAdmin ? (
100
+ < MultiSelect
101
+ className = "mt-2"
102
+ defaultValue = { question . categories as string [ ] }
103
+ options = { CategoryEnumArray . map ( ( category ) => ( {
104
+ label : category ,
105
+ value : category ,
106
+ } ) ) }
107
+ onValueChange = { ( v ) =>
108
+ setQuestion ( {
109
+ ...question ,
110
+ categories : v as CategoryEnum [ ] ,
111
+ } )
112
+ }
113
+ />
114
+ ) : (
115
+ < Input
116
+ className = "mt-2"
117
+ value = { question . categories . join ( ", " ) }
118
+ disabled
119
+ />
120
+ ) }
113
121
</ div >
114
122
115
123
< div >
You can’t perform that action at this time.
0 commit comments