feat: added dropdown component
This commit is contained in:
@@ -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;
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import { create } from "zustand";
|
||||
import { ExtendedLink, NewLink } from "@/types/global";
|
||||
|
||||
type LinkSlice = {
|
||||
type LinkStore = {
|
||||
links: ExtendedLink[];
|
||||
setLinks: () => void;
|
||||
addLink: (linkName: NewLink) => Promise<boolean>;
|
||||
@@ -9,7 +9,7 @@ type LinkSlice = {
|
||||
removeLink: (linkId: number) => void;
|
||||
};
|
||||
|
||||
const useLinkSlice = create<LinkSlice>()((set) => ({
|
||||
const useLinkStore = create<LinkStore>()((set) => ({
|
||||
links: [],
|
||||
setLinks: async () => {
|
||||
const response = await fetch("/api/routes/links");
|
||||
@@ -47,4 +47,4 @@ const useLinkSlice = create<LinkSlice>()((set) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export default useLinkSlice;
|
||||
export default useLinkStore;
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
import { create } from "zustand";
|
||||
import { Tag } from "@prisma/client";
|
||||
|
||||
type TagSlice = {
|
||||
type TagStore = {
|
||||
tags: Tag[];
|
||||
setTags: () => void;
|
||||
};
|
||||
|
||||
const useTagSlice = create<TagSlice>()((set) => ({
|
||||
const useTagStore = create<TagStore>()((set) => ({
|
||||
tags: [],
|
||||
setTags: async () => {
|
||||
const response = await fetch("/api/routes/tags");
|
||||
@@ -17,4 +17,4 @@ const useTagSlice = create<TagSlice>()((set) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export default useTagSlice;
|
||||
export default useTagStore;
|
||||
|
||||
Reference in New Issue
Block a user