13 lines
435 B
TypeScript
13 lines
435 B
TypeScript
import useLogin from "@/Hooks/useLogin";
|
|
import { RootTabRoutes } from "@/Pages/Root/RootTabRoutes";
|
|
|
|
export const DefaultTab = () => {
|
|
const { preferences, publicKey } = useLogin(s => ({
|
|
preferences: s.appData.item.preferences,
|
|
publicKey: s.publicKey,
|
|
}));
|
|
const tab = publicKey ? preferences.defaultRootTab ?? `notes` : `trending/notes`;
|
|
const elm = RootTabRoutes.find(a => a.path === tab)?.element;
|
|
return elm;
|
|
};
|