package com.develop.step.ui.recipes_detail

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.develop.common.ui.CommonBVMFragment
import com.develop.step.databinding.FragmentDetailCookDescBinding
import com.develop.step.viewmodel.CookDetailViewModel

class CookDetailDescFragment :
    CommonBVMFragment<FragmentDetailCookDescBinding, CookDetailViewModel>() {
    override fun createViewModel(): CookDetailViewModel {
        return getViewModelOfActivity(CookDetailViewModel::class.java)
    }

    override fun createViewBinding(
        inflater: LayoutInflater,
        container: ViewGroup?
    ): FragmentDetailCookDescBinding {
        return FragmentDetailCookDescBinding.inflate(inflater, container, false)
    }

    override fun onPostCreateView() {
        super.onPostCreateView()
        viewModel.getRecipeLiveData().observe(viewLifecycleOwner) {
            binding.tvStepDetail.text = it.recipe.introduction
        }
    }
}