mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
21 lines
544 B
TypeScript
21 lines
544 B
TypeScript
import { createContext } from 'react';
|
|
import { CollectionWithLinks } from '~/types/app';
|
|
|
|
type CollectionsContextType = {
|
|
collections: CollectionWithLinks[];
|
|
setCollections: (
|
|
collections: CollectionWithLinks[]
|
|
) => void | CollectionWithLinks[];
|
|
};
|
|
|
|
const iCollectionsContextState: CollectionsContextType = {
|
|
collections: [] as CollectionWithLinks[],
|
|
setCollections: (_: CollectionWithLinks[]) => {},
|
|
};
|
|
|
|
const CollectionsContext = createContext<CollectionsContextType>(
|
|
iCollectionsContextState
|
|
);
|
|
|
|
export default CollectionsContext;
|