package com.develop.step

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.develop.food.base.ui.FullScreenTransparentDialog
import com.develop.step.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
    }
}