package com.blaze.rtnblazesdk.events import com.blaze.blazesdk.delegates.models.BlazeCTAActionType import com.blaze.rtnblazesdk.utils.mapToReact import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.WritableMap class WidgetCTAClickEvent( surfaceId: Int, viewTag: Int, private val widgetId: String?, private val actionType: BlazeCTAActionType, private val actionParam: String ) : BaseEvent(surfaceId, viewTag) { companion object { // The name just needs to be unique, the way it's called on the React side is defined elsewhere. const val EVENT_NAME = "Blaze.WidgetCTAClickEvent" } override fun getEventName(): String { return EVENT_NAME } override fun getEventData(): WritableMap? { val params = Arguments.createMap() params.putString("widgetId", widgetId) params.putString("actionType", actionType.mapToReact()) params.putString("actionParam", actionParam) return params } }