quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/hooks/useBrainManagementTabs.ts

22 lines
526 B
TypeScript
Raw Normal View History

import { UUID } from "crypto";
import { useParams } from "next/navigation";
2023-07-25 10:54:34 +03:00
import { useState } from "react";
import { BrainManagementTab } from "../types";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const useBrainManagementTabs = () => {
const [selectedTab, setSelectedTab] =
useState<BrainManagementTab>("settings");
const params = useParams();
const brainId = params?.brainId as UUID | undefined;
2023-07-25 10:54:34 +03:00
return {
selectedTab,
setSelectedTab,
brainId,
2023-07-25 10:54:34 +03:00
};
};