export const ForgetPasswordFragment = (configuration) => {
  return `
    package ${configuration.packageName}.ui.fragments

    import android.os.Bundle
    import android.view.View
    import androidx.core.widget.doAfterTextChanged
    import androidx.fragment.app.Fragment
    import androidx.navigation.fragment.findNavController
    import ${configuration.name}.R
    import ${configuration.packageName}.data.local.AppPreferences
    import ${configuration.name}.databinding.FragmentForgetPasswordBinding
    import ${configuration.packageName}.extensions.setOnClickWithDebounce
    import ${configuration.packageName}.extensions.snackBar
    import ${configuration.packageName}.extensions.viewBinding
    import ${configuration.packageName}.network.Status
    import ${configuration.packageName}.viewmodels.BaasViewModel
    import ${configuration.packageName}.extensions.hideSoftKeyboard
    import org.koin.android.ext.android.inject
    import org.koin.androidx.viewmodel.ext.android.viewModel
    import android.widget.VideoView
    import androidx.activity.result.contract.ActivityResultContracts
    import com.manaknight.app.extensions.viewBinding
    import android.provider.MediaStore
    import android.widget.Toast
    import androidx.appcompat.app.AppCompatActivity



class ForgetPasswordFragment : Fragment(R.layout.fragment_forget_password) {

    private val binding by viewBinding(FragmentForgetPasswordBinding::bind)
    private val baasViewModel: BaasViewModel by viewModel()
    var email = ""

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        binding.forgetPassword.doAfterTextChanged { email = it.toString() }

        binding.continueButton.setOnClickListener {

            if (email.isEmpty()) {
                Toast.makeText(context, "Please enter email address.", Toast.LENGTH_SHORT).show();
            } else {
                requireActivity().hideSoftKeyboard()
                baasViewModel.forgotPasswordMobile(email).observe(viewLifecycleOwner) {
                    when (it.status) {
                        Status.ERROR -> snackBar(it.message ?: getString(R.string.something_went_wrong))
                        Status.LOADING -> {
                            snackBar("Loading")
                        }

                        Status.SUCCESS -> {  
                            snackBar("Reset code sent to email")

                           findNavController().navigate(R.id.resetPasswordFragment)
                        }
                    }
                }
            }
        }

    }

      override fun onResume() {
            super.onResume()
            // (activity as AppCompatActivity?)!!.supportActionBar!!.hide()
        }

        override fun onStop() {
            super.onStop()
            // (activity as AppCompatActivity?)!!.supportActionBar!!.show()
        }

}
    `;
};
