package com.pan_american.android.ui.financial_module.expense_approval

import android.os.Bundle
import com.pan_american.android.R
import com.pan_american.android.base.BaseActivity
import com.pan_american.android.databinding.ActivityExpenseApprovalBinding
import com.pan_american.android.databinding.LayoutTitleBinding

class ExpenseApprovalActivity : BaseActivity<ActivityExpenseApprovalBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

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

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

        initTitle()

        supportFragmentManager.beginTransaction().addToBackStack(null)
            .add(binding.expenseApprovalContainer.id, ExpenseApprovalGroupListFragment()).commit()
    }

    override fun initTitle() {
        titleBinding = LayoutTitleBinding.bind(binding.root).apply {
            titleText.text = resources.getString(R.string.expense_approval)

            backButton.setOnClickListener {
                back()
            }
        }
    }
}