mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-13 10:44:08 +00:00
1b83a6fd8a
* context menu on path bar * Open in new tab * locales * Update ExplorerPath.tsx
18 lines
442 B
TypeScript
18 lines
442 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
import { Router } from './';
|
|
|
|
export const TabsContext = createContext<{
|
|
tabIndex: number;
|
|
setTabIndex: (i: number) => void;
|
|
tabs: { router: Router; title: string }[];
|
|
createTab(redirect?: { pathname: string; search: string | undefined }): void;
|
|
removeTab(index: number): void;
|
|
} | null>(null);
|
|
|
|
export function useTabsContext() {
|
|
const ctx = useContext(TabsContext);
|
|
|
|
return ctx;
|
|
}
|