diff --git a/src/components/chat/ReactionButtons.tsx b/src/components/chat/ReactionButtons.tsx index 163b5dc..346aef9 100644 --- a/src/components/chat/ReactionButtons.tsx +++ b/src/components/chat/ReactionButtons.tsx @@ -1,4 +1,4 @@ -import { CheckIcon, CloseIcon, CopyIcon, DislikeIcon, LikeIcon } from '@/components/svg' +import { CheckIcon, CloseIcon, CopyIcon, DislikeIcon, FlagIcon, LikeIcon } from '@/components/svg' import { useDirection, useFeedbackHandler, useFeedbackService, useScreenInfo } from '@/hooks' import { FeedbackClass, Message, ReactionButtonsState, RootState } from '@/store' import { createGeneralThemedStyles } from '@/utils' @@ -86,6 +86,10 @@ const ReactionButtons: React.FC = ({ threadId, messageId, feedbackOptions = feedbacks.bad || [] } + if (selectedFeedbackClass === FeedbackClass.RedFlag) { + feedbackOptions = feedbacks.redflag || [] + } + return ( {feedbackOptions.map((option) => ( @@ -154,6 +158,21 @@ const ReactionButtons: React.FC = ({ threadId, messageId, height={24} /> + { + handleFeedbackAction(FeedbackClass.RedFlag) + setEditing(true) + }} + className={`w-5 h-5 ${isRTL ? 'mr-2' : 'ml-2'}`} + hitSlop={8} + > + + {modalVisible && ( diff --git a/src/components/svg/FlagIcon.tsx b/src/components/svg/FlagIcon.tsx index 4f6da44..a11c360 100644 --- a/src/components/svg/FlagIcon.tsx +++ b/src/components/svg/FlagIcon.tsx @@ -12,7 +12,8 @@ const FlagIcon: React.FC = (props: Props) => { width={props.width || '24'} height={props.height || '24'} viewBox={props.viewBox || '0 0 24 24'} - fill={props.fill || '#08786B'} + fill={props.fill || 'currentColor'} + stroke={props.stroke || 'currentColor'} transform={props.transform || transform} > diff --git a/src/i18n/locales/ar/feedback.json b/src/i18n/locales/ar/feedback.json index 7da8255..9464318 100644 --- a/src/i18n/locales/ar/feedback.json +++ b/src/i18n/locales/ar/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "مضارب / غير آمن", - "value": "offensive" - }, { "id": "bad2", "label": "لا يكون صحيحاً في الواقع", @@ -32,5 +27,17 @@ "label": "أخرى", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "مضارب / غير آمن", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "أخرى", + "value": "other" + } ] -} +} \ No newline at end of file diff --git a/src/i18n/locales/bs/feedback.json b/src/i18n/locales/bs/feedback.json index 0176caf..06fcb6c 100644 --- a/src/i18n/locales/bs/feedback.json +++ b/src/i18n/locales/bs/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "Neprikladno / Neposredno", - "value": "offensive" - }, { "id": "bad2", "label": "Nepravilno faktično", @@ -32,5 +27,17 @@ "label": "Drugo", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "Neprikladno / Neposredno", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "Drugo", + "value": "other" + } ] -} +} \ No newline at end of file diff --git a/src/i18n/locales/en/feedback.json b/src/i18n/locales/en/feedback.json index 777d3d8..a8a7202 100644 --- a/src/i18n/locales/en/feedback.json +++ b/src/i18n/locales/en/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "Offensive / Unsafe", - "value": "offensive" - }, { "id": "bad2", "label": "Not factually correct", @@ -32,5 +27,17 @@ "label": "Other", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "Offensive / Unsafe", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "Other", + "value": "other" + } ] } diff --git a/src/i18n/locales/fr/feedback.json b/src/i18n/locales/fr/feedback.json index 6687374..423380c 100644 --- a/src/i18n/locales/fr/feedback.json +++ b/src/i18n/locales/fr/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "Offensif / Dangereux", - "value": "offensive" - }, { "id": "bad2", "label": "Pas exactement correct", @@ -32,5 +27,17 @@ "label": "Autre", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "Offensif / Dangereux", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "Autre", + "value": "other" + } ] -} +} \ No newline at end of file diff --git a/src/i18n/locales/id/feedback.json b/src/i18n/locales/id/feedback.json index 556a041..c9c417c 100644 --- a/src/i18n/locales/id/feedback.json +++ b/src/i18n/locales/id/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "Kasar / Tidak aman", - "value": "offensive" - }, { "id": "bad2", "label": "Tidak benar fakta", @@ -32,5 +27,17 @@ "label": "Lainnya", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "Kasar / Tidak aman", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "Lainnya", + "value": "other" + } ] -} +} \ No newline at end of file diff --git a/src/i18n/locales/tml/feedback.json b/src/i18n/locales/tml/feedback.json index 8c41421..ff01808 100644 --- a/src/i18n/locales/tml/feedback.json +++ b/src/i18n/locales/tml/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "அவமதிப்பான/மனத்தை புண்படுத்துகிற/பாதுகாப்பற்ற தகவல் ", - "value": "offensive" - }, { "id": "bad2", "label": "உண்மையற்றது/தவறான தகவல்", @@ -32,5 +27,17 @@ "label": "தவறான தகவல்", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "அவமதிப்பான/மனத்தை புண்படுத்துகிற/பாதுகாப்பற்ற தகவல் ", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "தவறான தகவல்", + "value": "other" + } ] } \ No newline at end of file diff --git a/src/i18n/locales/tur/feedback.json b/src/i18n/locales/tur/feedback.json index 4c6b7b8..ac1b13f 100644 --- a/src/i18n/locales/tur/feedback.json +++ b/src/i18n/locales/tur/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "Saldırgan / Tehlikeli", - "value": "offensive" - }, { "id": "bad2", "label": "Tamamen Doğru Değil", @@ -32,5 +27,17 @@ "label": "Diğer", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "Saldırgan / Tehlikeli", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "Diğer", + "value": "other" + } ] -} +} \ No newline at end of file diff --git a/src/i18n/locales/ur/feedback.json b/src/i18n/locales/ur/feedback.json index 29f6f09..dc29817 100644 --- a/src/i18n/locales/ur/feedback.json +++ b/src/i18n/locales/ur/feedback.json @@ -17,11 +17,6 @@ } ], "bad": [ - { - "id": "bad1", - "label": "توہین آمیز / نا محفوظ", - "value": "offensive" - }, { "id": "bad2", "label": "حقائقی طور پر غلط", @@ -32,5 +27,17 @@ "label": "دیگر", "value": "other" } + ], + "redflag": [ + { + "id": "redflag1", + "label": "توہین آمیز / نا محفوظ", + "value": "offensive" + }, + { + "id": "redflag2", + "label": "دیگر", + "value": "other" + } ] -} +} \ No newline at end of file diff --git a/src/services/FeedbackService.ts b/src/services/FeedbackService.ts index bcca16e..3048393 100644 --- a/src/services/FeedbackService.ts +++ b/src/services/FeedbackService.ts @@ -17,6 +17,7 @@ export type Feedback = { export type FeedbacksByCategory = { good: Feedback[] bad: Feedback[] + redflag: Feedback[] [key: string]: Feedback[] }