* chore: pwa dropdown input focus improvement * chore: tab indices helper function updated and code refactor * chore: modal tab index refactoring * fix: PWA filters input autofocus * chore: intake tab index updated and code refactor * chore: code refactor
10 lines
373 B
TypeScript
10 lines
373 B
TypeScript
import { ETabIndices, TAB_INDEX_MAP } from "@/constants/tab-indices";
|
|
|
|
export const getTabIndex = (type?: ETabIndices, isMobile: boolean = false) => {
|
|
const getIndex = (key: string) =>
|
|
isMobile ? undefined : type && TAB_INDEX_MAP[type].findIndex((tabIndex) => tabIndex === key) + 1;
|
|
|
|
const baseTabIndex = isMobile ? -1 : 1;
|
|
|
|
return { getIndex, baseTabIndex };
|
|
};
|