feat: implement comprehensive notification engine with policies, preferences, and automated dispatching services
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import { create } from "zustand";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
interface IConfirmStore {
|
||||
visible: boolean;
|
||||
message: string;
|
||||
content?: ReactNode;
|
||||
title: string;
|
||||
onConfirm: () => void;
|
||||
onCancel: () => void;
|
||||
show: (message: string, onConfirm: () => void, onCancel: () => void) => void;
|
||||
showContent: (message: string, content: ReactNode, onConfirm: () => void, onCancel: () => void) => void;
|
||||
close: () => void;
|
||||
clear: () => void;
|
||||
}
|
||||
@@ -16,6 +19,7 @@ export type ConfirmState = IConfirmStore;
|
||||
const useConfirmStore = create<ConfirmState>()((set) => ({
|
||||
visible: false,
|
||||
message: "",
|
||||
content: undefined,
|
||||
title: "",
|
||||
onConfirm: () => {},
|
||||
onCancel: () => {},
|
||||
@@ -23,6 +27,16 @@ const useConfirmStore = create<ConfirmState>()((set) => ({
|
||||
set(() => ({
|
||||
visible: true,
|
||||
message: message,
|
||||
content: undefined,
|
||||
onConfirm: onConfirm,
|
||||
onCancel: onCancel,
|
||||
title: "Atención",
|
||||
})),
|
||||
showContent: (message: string, content: ReactNode, onConfirm: () => void, onCancel: () => void) =>
|
||||
set(() => ({
|
||||
visible: true,
|
||||
message: message,
|
||||
content: content,
|
||||
onConfirm: onConfirm,
|
||||
onCancel: onCancel,
|
||||
title: "Atención",
|
||||
@@ -31,6 +45,7 @@ const useConfirmStore = create<ConfirmState>()((set) => ({
|
||||
set(() => ({
|
||||
visible: false,
|
||||
message: "",
|
||||
content: undefined,
|
||||
onConfirm: () => {},
|
||||
onCancel: () => {},
|
||||
title: "",
|
||||
@@ -39,6 +54,7 @@ const useConfirmStore = create<ConfirmState>()((set) => ({
|
||||
set(() => ({
|
||||
visible: false,
|
||||
message: "",
|
||||
content: undefined,
|
||||
onConfirm: () => {},
|
||||
onCancel: () => {},
|
||||
title: "",
|
||||
|
||||
Reference in New Issue
Block a user