Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function transformAction(
appBridge: ClientApplication<{}>,
action: ComplexAction,
) {
const style = action.destructive === true ? Button.Style.Danger : undefined;
const button = Button.create(appBridge, {
label: action.content || '',
disabled: action.disabled,
style,
});
if (action.onAction) {
button.subscribe(Button.Action.CLICK, action.onAction);
}
const redirect = generateRedirect(
appBridge,
action.url,
action.target,
action.external,