package kr.co.vividnext.sodalive.extensions

import android.widget.ImageView
import coil.load
import coil.request.ImageRequest
import kr.co.vividnext.sodalive.common.ImageLoaderProvider
import kr.co.vividnext.sodalive.common.ImageLoaderProvider.imageLoader

fun ImageView.loadUrl(url: String?, builder: ImageRequest.Builder.() -> Unit = {}) {
    if (!ImageLoaderProvider.isInitialized) {
        throw IllegalStateException("ImageLoaderProvider is not initialized")
    }
    this.load(url, imageLoader, builder)
}
