@@ -9,12 +9,14 @@ interface Props {
9
9
10
10
export default function FeedbackModal ( { messages, setOpenFeedback } : Props ) {
11
11
const [ feedback , setFeedback ] = useState ( "" ) ;
12
+ const [ wordsToRedact , setWordsToRedact ] = useState ( "" ) ;
12
13
const [ status , setStatus ] = useState ( "idle" ) ;
13
14
14
15
const handleModalClose = ( ) => {
15
16
setOpenFeedback ( false ) ;
16
17
setStatus ( "idle" ) ;
17
18
setFeedback ( "" ) ;
19
+ setWordsToRedact ( "" ) ;
18
20
} ;
19
21
20
22
return (
@@ -23,11 +25,19 @@ export default function FeedbackModal({ messages, setOpenFeedback }: Props) {
23
25
className = "absolute top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%] flex flex-col gap-4 items-center justify-center w-[300px] sm:w-[500px] h-[300px] rounded-lg p-4"
24
26
>
25
27
{ status === "idle" ? (
26
- < textarea
27
- className = "resize-none h-[80%] w-full px-3 py-2 border-1 border-[#ddd] rounded-md box-border transition-colors duration-300 focus:outline-0 focus:border-[#4a90e2] focus:shadow-[0_0_0_2px_rgba(74,144,226,0.2)]"
28
- placeholder = "Please enter your feedback with regards to the chatbot here. A copy of your chat transcript will automatically be included with your response."
29
- onChange = { ( event ) => setFeedback ( event . target . value ) }
30
- />
28
+ < >
29
+ < textarea
30
+ className = "resize-none h-[80%] w-full px-3 py-2 border-1 border-[#ddd] rounded-md box-border transition-colors duration-300 focus:outline-0 focus:border-[#4a90e2] focus:shadow-[0_0_0_2px_rgba(74,144,226,0.2)]"
31
+ placeholder = "Please enter your feedback with regards to the chatbot here. A copy of your chat transcript will automatically be included with your response."
32
+ onChange = { ( event ) => setFeedback ( event . target . value ) }
33
+ />
34
+ < input
35
+ className = "resize-none h-[20%] w-full px-3 py-2 border-1 border-[#ddd] rounded-md box-border transition-colors duration-300 focus:outline-0 focus:border-[#4a90e2] focus:shadow-[0_0_0_2px_rgba(74,144,226,0.2)]"
36
+ placeholder = "Please enter words to redact separated by commas"
37
+ type = "text"
38
+ onChange = { ( event ) => setWordsToRedact ( event . target . value ) }
39
+ />
40
+ </ >
31
41
) : (
32
42
< div className = "flex items-center justify-center h-[80%] w-full" >
33
43
< p > Feedback Sent!</ p >
@@ -40,7 +50,7 @@ export default function FeedbackModal({ messages, setOpenFeedback }: Props) {
40
50
if ( feedback . trim ( ) === "" ) handleModalClose ( ) ;
41
51
setStatus ( "sending" ) ;
42
52
setTimeout ( ( ) => {
43
- sendFeedback ( messages , feedback ) ;
53
+ sendFeedback ( messages , feedback , wordsToRedact ) ;
44
54
handleModalClose ( ) ;
45
55
} , 1000 ) ;
46
56
} }
0 commit comments