package net.pokeranalytics.android.ui.fragment.components.bottomsheet

enum class BottomSheetType {
	NONE,
	LIST,
	LIST_STATIC,
	LIST_GAME,
	DOUBLE_LIST,
	MULTI_SELECTION,
	GRID,
	EDIT_TEXT,
	EDIT_TEXT_MULTI_LINES,
	DOUBLE_EDIT_TEXT,
	NUMERIC_TEXT,
	SUM;

	fun newInstance(): BottomSheetFragment {
		return when (this) {
			NONE -> BottomSheetFragment()
			LIST -> BottomSheetListFragment()
			LIST_STATIC -> BottomSheetStaticListFragment()
			LIST_GAME -> BottomSheetListGameFragment()
			DOUBLE_LIST -> BottomSheetListGameFragment()
			MULTI_SELECTION -> BottomSheetMultiSelectionFragment()
			GRID -> BottomSheetTableSizeGridFragment()
			EDIT_TEXT -> BottomSheetEditTextFragment()
			EDIT_TEXT_MULTI_LINES -> BottomSheetEditTextMultiLinesFragment()
			DOUBLE_EDIT_TEXT -> BottomSheetDoubleEditTextFragment()
			NUMERIC_TEXT -> BottomSheetNumericTextFragment()
			SUM -> BottomSheetSumFragment()
		}
	}

	val validationRequired: Boolean
		get() = when (this) {
			LIST, LIST_GAME, LIST_STATIC, GRID, DOUBLE_LIST -> false
			else -> true
		}

	val clearRequired: Boolean
		get() = true

	val addRequired: Boolean
		get() = when (this) {
			EDIT_TEXT, NUMERIC_TEXT, DOUBLE_EDIT_TEXT, EDIT_TEXT_MULTI_LINES, GRID, LIST_STATIC, SUM -> false
			else -> true
		}
}