mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
feat: recreate dashboard page from previous version
This commit is contained in:
18
inertia/contexts/collections_context.ts
Normal file
18
inertia/contexts/collections_context.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import Collection from '#models/collection';
|
||||
import { createContext } from 'react';
|
||||
|
||||
type CollectionsContextType = {
|
||||
collections: Collection[];
|
||||
setCollections: (collections: Collection[]) => void | Collection[];
|
||||
};
|
||||
|
||||
const iCollectionsContextState: CollectionsContextType = {
|
||||
collections: [] as Collection[],
|
||||
setCollections: (_: Collection[]) => {},
|
||||
};
|
||||
|
||||
const CollectionsContext = createContext<CollectionsContextType>(
|
||||
iCollectionsContextState
|
||||
);
|
||||
|
||||
export default CollectionsContext;
|
||||
Reference in New Issue
Block a user