mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-01-30 16:43:37 +00:00
15 lines
363 B
TypeScript
15 lines
363 B
TypeScript
import { create } from 'zustand';
|
|
|
|
type CardModalStore = {
|
|
id?: string;
|
|
isOpen: boolean;
|
|
onOpen: (id: string) => void;
|
|
onClose: () => void;
|
|
};
|
|
|
|
export const useCardModal = create<CardModalStore>((set) => ({
|
|
id: undefined,
|
|
isOpen: false,
|
|
onOpen: (id: string) => set({ isOpen: true, id }),
|
|
onClose: () => set({ isOpen: false, id: undefined }),
|
|
}));
|