package com.pan_american.android.ui.group_visa.insurance_payment_insert

import android.os.Bundle
import com.pan_american.android.OASystem
import com.pan_american.android.R
import com.pan_american.android.base.BaseActivity
import com.pan_american.android.databinding.ActivityInsurancePaymentInsertBinding
import com.pan_american.android.databinding.LayoutTitleBinding
import com.pan_american.android.ui.group_simple_info.GroupSimpleInfoFragment

class InsurancePaymentInsertActivity : BaseActivity<ActivityInsurancePaymentInsertBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

    override fun getViewBinding() = ActivityInsurancePaymentInsertBinding.inflate(layoutInflater)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        initTitle()
        initViews()
    }

    override fun initTitle() {
        titleBinding = LayoutTitleBinding.bind(binding.root).apply {
            titleText.text = resources.getString(R.string.insurance_payment_insert)
            backButton.setOnClickListener {
                back()
            }
        }
    }

    override fun initViews() {
        val bundle = Bundle().apply {
            putInt("id", OASystem.C_TABLE_INSURANCE)
        }

        val groupSimpleInfoFragment = GroupSimpleInfoFragment()
        groupSimpleInfoFragment.arguments = bundle

        supportFragmentManager.beginTransaction().addToBackStack(null)
            .add(binding.insuranceInsertContainer.id, groupSimpleInfoFragment).commit()
    }
}