package com.develop.common.dialog

import android.content.DialogInterface
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.develop.base.mvvm.FullScreenTransparentDialog
import com.develop.common.databinding.DialogCookStepCompleteBinding

class CookStepCompleteDialog(
    var clickOk: (() -> Unit)?
): FullScreenTransparentDialog() {

    private lateinit var binding: DialogCookStepCompleteBinding

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        binding = DialogCookStepCompleteBinding.inflate(
            inflater, container, false
        )
        binding.tvOk.setOnClickListener {
            clickOk?.invoke()
            removeSelf()
        }
        return binding.root
    }

    override fun onDismiss(dialog: DialogInterface) {
        super.onDismiss(dialog)
        clickOk = null
    }

}