diff --git a/src/CONST.ts b/src/CONST.ts index db3f479aa466..b5d23702bd17 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -523,6 +523,7 @@ const CONST = { TASKCOMPLETED: 'TASKCOMPLETED', TASKEDITED: 'TASKEDITED', TASKREOPENED: 'TASKREOPENED', + ACTIONABLEMENTIONWHISPER: 'ACTIONABLEMENTIONWHISPER', POLICYCHANGELOG: { ADD_APPROVER_RULE: 'POLICYCHANGELOG_ADD_APPROVER_RULE', ADD_BUDGET: 'POLICYCHANGELOG_ADD_BUDGET', @@ -596,6 +597,10 @@ const CONST = { }, THREAD_DISABLED: ['CREATED'], }, + ACTIONABLE_MENTION_WHISPER_RESOLUTION: { + INVITE: 'invited', + NOTHING: 'nothing', + }, ARCHIVE_REASON: { DEFAULT: 'default', ACCOUNT_CLOSED: 'accountClosed', diff --git a/src/components/ReportActionItem/ActionableItemButtons.tsx b/src/components/ReportActionItem/ActionableItemButtons.tsx new file mode 100644 index 000000000000..d1f169d2f409 --- /dev/null +++ b/src/components/ReportActionItem/ActionableItemButtons.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import {View} from 'react-native'; +import Button from '@components/Button'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import type {TranslationPaths} from '@src/languages/types'; + +type ActionableItem = { + isPrimary?: boolean; + key: string; + onPress: () => void; + text: TranslationPaths; +}; + +type ActionableItemButtonsProps = { + items: ActionableItem[]; +}; + +function ActionableItemButtons(props: ActionableItemButtonsProps) { + const styles = useThemeStyles(); + const {translate} = useLocalize(); + + return ( + + {props.items?.map((item) => ( + )} + {/** + These are the actionable buttons that appear at the bottom of a Concierge message + for example: Invite a user mentioned but not a member of the room + https://github.com/Expensify/App/issues/32741 + */} + {actionableItemButtons.length > 0 && ( + + )} ) : ( ; type OriginalMessageApproved = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.APPROVED; @@ -109,6 +110,18 @@ type OriginalMessageAddComment = { }; }; +type OriginalMessageActionableMentionWhisper = { + actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLEMENTIONWHISPER; + originalMessage: { + inviteeAccountIDs: number[]; + inviteeEmails: string; + lastModified: string; + reportID: number; + resolution?: ValueOf | null; + whisperedTo?: number[]; + }; +}; + type OriginalMessageSubmitted = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED; originalMessage: unknown; @@ -239,6 +252,7 @@ type OriginalMessage = | OriginalMessageApproved | OriginalMessageIOU | OriginalMessageAddComment + | OriginalMessageActionableMentionWhisper | OriginalMessageSubmitted | OriginalMessageClosed | OriginalMessageCreated diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index a881b63fbb95..ea987a903b1b 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -52,6 +52,9 @@ type Message = { /** ID of a task report */ taskReportID?: string; + + /** resolution for actionable mention whisper */ + resolution?: ValueOf | null; }; type ImageMetadata = {