package com.tangem.features.swap.v2.impl.choosetoken.fromSupported.model

import com.tangem.core.ui.components.bottomsheets.message.*
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.extensions.wrappedList
import com.tangem.features.swap.v2.impl.R

internal object SwapChooseTokenFactory {

    fun getErrorMessage(tokenName: String, onDismiss: () -> Unit): MessageBottomSheetUM {
        return messageBottomSheetUM {
            infoBlock {
                icon(R.drawable.ic_alert_triangle_20) {
                    type = MessageBottomSheetUM.Icon.Type.Attention
                    backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
                }
                title = resourceReference(R.string.express_swap_not_supported_title, wrappedList(tokenName))
                body = resourceReference(R.string.express_swap_not_supported_text)
            }
            secondaryButton {
                text = resourceReference(R.string.warning_button_ok)
                onClick { onDismiss() }
            }
        }
    }

    fun getSwapAvailableMessage(tokenName: String, onSwapClick: () -> Unit): MessageBottomSheetUM {
        return messageBottomSheetUM {
            infoBlock {
                icon(R.drawable.ic_alert_triangle_20) {
                    type = MessageBottomSheetUM.Icon.Type.Attention
                    backgroundType = MessageBottomSheetUM.Icon.BackgroundType.SameAsTint
                }
                title = resourceReference(
                    R.string.express_send_with_swap_not_supported_title,
                    wrappedList(tokenName),
                )
                body = resourceReference(R.string.express_send_with_swap_not_supported_text)
            }
            primaryButton {
                text = resourceReference(R.string.express_send_with_swap_not_supported_button)
                onClick { onSwapClick() }
            }
        }
    }
}