feat: added dropdown component

This commit is contained in:
Daniel
2023-03-23 02:41:54 +03:30
parent e5e2a615fc
commit f80113c487
20 changed files with 152 additions and 54 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import { create } from "zustand";
import { Collection } from "@prisma/client";
type CollectionSlice = {
type CollectionStore = {
collections: Collection[];
setCollections: () => void;
addCollection: (collectionName: string) => void;
@@ -9,7 +9,7 @@ type CollectionSlice = {
removeCollection: (collectionId: number) => void;
};
const useCollectionSlice = create<CollectionSlice>()((set) => ({
const useCollectionStore = create<CollectionStore>()((set) => ({
collections: [],
setCollections: async () => {
const response = await fetch("/api/routes/collections");
@@ -47,4 +47,4 @@ const useCollectionSlice = create<CollectionSlice>()((set) => ({
},
}));
export default useCollectionSlice;
export default useCollectionStore;