20 lines
431 B
TypeScript
20 lines
431 B
TypeScript
import { CategoryType } from "@/lib/types";
|
|
import { create } from "zustand";
|
|
|
|
interface CategoryZustandType {
|
|
category: CategoryType;
|
|
setCategory: (category: CategoryType) => void;
|
|
}
|
|
|
|
const demoCategory: CategoryType = {
|
|
id: 0,
|
|
name: "",
|
|
description: "",
|
|
image: "",
|
|
};
|
|
|
|
export const useCategory = create<CategoryZustandType>((set) => ({
|
|
category: demoCategory,
|
|
setCategory: (data) => set({ category: data }),
|
|
}));
|