Files
outline/shared/hooks/useShare.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

19 lines
423 B
TypeScript

import type { NavigationNode } from "../types";
import * as React from "react";
type ShareContextType = {
shareId?: string;
sharedTree?: NavigationNode;
};
export const ShareContext = React.createContext<ShareContextType>({});
export default function useShare(): ShareContextType & { isShare: boolean } {
const value = React.useContext(ShareContext);
return {
...value,
isShare: !!value.shareId,
};
}