package com.blaze.rtnblazesdk.utils import BlazeReactMomentsPlayerStyle import BlazeReactStoryPlayerStyle import android.content.Context import com.blaze.blazesdk.shared.BlazeSDK import com.blaze.blazesdk.style.players.moments.BlazeMomentsPlayerStyle import com.blaze.blazesdk.style.players.stories.BlazeStoryPlayerStyle import com.blaze.rtnblazesdk.customization.mergedWith import com.blaze.rtnblazesdk.utils.parsing.toObject import com.facebook.react.bridge.ReadableMap fun ReadableMap?.extractStoriesPlayerStyle(context: Context): BlazeStoryPlayerStyle { val reactTheme = this ?: return BlazeSDK.getDefaultStoryPlayerStyle() val customization = reactTheme.toObject() return BlazeStoryPlayerStyle.base().mergedWith(customization = customization,context) } fun ReadableMap?.extractMomentsPlayerStyle(context: Context): BlazeMomentsPlayerStyle { val reactTheme = this ?: return BlazeSDK.getDefaultMomentsPlayerStyle() val customization = reactTheme.toObject() return BlazeMomentsPlayerStyle.base().mergedWith(customization = customization,context) }