quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/utils/getTargetedTab.ts
2023-08-31 16:02:32 +02:00

9 lines
323 B
TypeScript

import { BrainManagementTab, brainManagementTabs } from "../types";
export const getTargetedTab = (): BrainManagementTab | undefined => {
const targetedTab = window.location.hash.split("#")[1];
if (brainManagementTabs.includes(targetedTab as BrainManagementTab)) {
return targetedTab as BrainManagementTab;
}
};