// @flow import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { ACTIVITY_TARGETS } from '../../../common/interactionTargets'; import messages from './messages'; import Button from '../../../../components/button'; import PrimaryButton from '../../../../components/primary-button'; import { TASK_TYPE_APPROVAL, TASK_TYPE_GENERAL } from '../../../../constants'; import type { TaskType } from '../../../../common/types/tasks'; import './TaskActions.scss'; type Props = {| isMultiFile: boolean, onTaskApproval: Function, onTaskComplete: Function, onTaskReject: Function, onTaskView: Function, taskType: TaskType, |}; const TaskActions = ({ isMultiFile, onTaskApproval, onTaskReject, onTaskComplete, onTaskView, taskType, }: Props): React.Node => { let action = null; if (isMultiFile) { action = onTaskView && ( ); } else if (taskType === TASK_TYPE_APPROVAL) { action = ( <> ); } else if (taskType === TASK_TYPE_GENERAL) { action = ( ); } return
{action}
; }; export default TaskActions;