chore(history): import initial web product snapshot

This commit is contained in:
wmq
2026-07-25 00:30:00 +08:00
commit cf0eed46c3
131 changed files with 15693 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { create } from 'zustand'
export interface ConfirmOptions {
title: string
description?: string
confirmText?: string
cancelText?: string
danger?: boolean
onConfirm: () => void | Promise<void>
}
interface ConfirmState {
current: ConfirmOptions | null
ask: (opts: ConfirmOptions) => void
close: () => void
}
export const useConfirmStore = create<ConfirmState>()((set) => ({
current: null,
ask: (opts) => set({ current: opts }),
close: () => set({ current: null }),
}))
/** 任意位置调用:confirmDialog({ title, danger, onConfirm }) */
export function confirmDialog(opts: ConfirmOptions): void {
useConfirmStore.getState().ask(opts)
}