package com.gamedog.vididin.features.withdrawrecord

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.gamedog.vididin.features.withdrawrecord.fragments.CashRecordFragment
import com.gamedog.vididin.features.withdrawrecord.fragments.GoldRecordFragment

class ViewPagerAdapter(fragmentActivity: FragmentActivity) : FragmentStateAdapter(fragmentActivity) {

    override fun getItemCount(): Int = 2

    override fun createFragment(position: Int): Fragment {
        return when (position) {
            0 -> CashRecordFragment()
            1 -> GoldRecordFragment()
            else -> throw IllegalArgumentException("Invalid position: $position")
        }
    }
}