package com.develop.common.dialog

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.DialogRecipeDeleteConfirmBinding


class RecipeDeleteConfirmDialog(
    private val onConfirm: () -> Unit
): FullScreenTransparentDialog() {

    private lateinit var binding: DialogRecipeDeleteConfirmBinding

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        binding = DialogRecipeDeleteConfirmBinding.inflate(
            inflater, container, false
        )
        binding.tvYes.setOnClickListener {
            onConfirm()
            removeSelf()
        }
        binding.tvCancel.setOnClickListener {
            removeSelf()
        }
        return binding.root
    }
}