-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
TaskAction.js
33 lines (27 loc) · 1.05 KB
/
TaskAction.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
import Text from '../Text';
import styles from '../../styles/styles';
import * as Task from '../../libs/actions/Task';
const propTypes = {
/** Name of the reportAction action */
actionName: PropTypes.string.isRequired,
/** The ID of the associated taskReport */
// eslint-disable-next-line react/no-unused-prop-types -- This is used in the withOnyx HOC
taskReportID: PropTypes.string.isRequired,
...withLocalizePropTypes,
};
function TaskAction(props) {
return (
<>
<View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}>
<Text style={[styles.chatItemMessage, styles.colorMuted]}>{Task.getTaskReportActionMessage(props.actionName, props.taskReportID, false)}</Text>
</View>
</>
);
}
TaskAction.propTypes = propTypes;
TaskAction.displayName = 'TaskAction';
export default withLocalize(TaskAction);