mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
16 lines
511 B
TypeScript
16 lines
511 B
TypeScript
import { createContext } from 'react';
|
|
import { CollectionWithLinks } from '~/types/app';
|
|
|
|
type ActiveCollectionContextType = {
|
|
activeCollection: CollectionWithLinks | null;
|
|
setActiveCollection: (collection: CollectionWithLinks) => void;
|
|
};
|
|
|
|
const iActiveCollectionContextState: ActiveCollectionContextType = {
|
|
activeCollection: null,
|
|
setActiveCollection: (_: CollectionWithLinks) => {},
|
|
};
|
|
|
|
export const ActiveCollectionContext =
|
|
createContext<ActiveCollectionContextType>(iActiveCollectionContextState);
|