package com.adealink.weparty.profile.search

import com.adealink.frame.aab.util.getCompatString
import com.adealink.weparty.commonui.BaseFragment
import com.adealink.weparty.profile.R
import com.adealink.weparty.profile.search.page.SearchAllFragment
import com.adealink.weparty.profile.search.page.SearchRoomFragment
import com.adealink.weparty.profile.search.page.SearchUserFragment

enum class SearchTab {
    ALL,
    USER,
    ROOM;
}

data class Tab(
    val type: SearchTab,
    val name: (() -> String),
    val fragmentBuilder: () -> BaseFragment
)

val ALL_TAB = Tab(
    type = SearchTab.ALL,
    name = {
        getCompatString(R.string.search_all_tab)
    },
    fragmentBuilder = {
        SearchAllFragment()
    }
)

val USER_TAB = Tab(
    type = SearchTab.USER,
    name = {
        getCompatString(R.string.search_user_tab)
    },
    fragmentBuilder = {
        SearchUserFragment()
    }
)

val ROOM_TAB = Tab(
    type = SearchTab.ROOM,
    name = {
        getCompatString(R.string.search_room_tab)
    },
    fragmentBuilder = {
        SearchRoomFragment()
    }
)


val SEARCH_TABS = listOf(
    ALL_TAB, USER_TAB, ROOM_TAB
)