Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const actionSection = (acceptAction, rejectAction, buttonOrder, emphasizedAction) => {
let acceptButton = null;
let rejectButton = null;
if (!acceptAction && !rejectAction) {
return null;
}
if (acceptAction) {
acceptButton = (emphasizedAction === 'accept')
? <button>
: </button><button>;
}
if (rejectAction) {
rejectButton = (emphasizedAction === 'reject')
? </button><button>
: </button><button>;
}
if (buttonOrder === 'rejectFirst') {
return (
<div>
{rejectButton}
{acceptButton}
</div>
);
}
return (
<div>
{acceptButton}
{rejectButton}</div></button>