templates store

Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
FTCHD
2025-09-18 13:45:54 +02:00
parent e8e2e28801
commit 44e2641656
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -4,6 +4,7 @@ import { create } from 'zustand'
import { type StateStorage, createJSONStorage, persist } from 'zustand/middleware'
import type { ConfigFile } from '../types/config'
import type { ScheduledTask } from '../types/task'
import type { Template } from '../types/template'
// const { LazyStore } = window.__TAURI__.store
const store = new LazyStore('store.json')
@@ -110,6 +111,8 @@ interface PersistedState {
removeScheduledTask: (id: string) => void
updateScheduledTask: (id: string, task: Partial<ScheduledTask>) => void
templates: Template[]
configFiles: ConfigFile[]
addConfigFile: (configFile: ConfigFile) => void
removeConfigFile: (id: string) => void
@@ -249,6 +252,8 @@ export const usePersistedStore = create<PersistedState>()(
),
})),
templates: [],
configFiles: [],
addConfigFile: (configFile: ConfigFile) =>
set((state) => ({
+6
View File
@@ -0,0 +1,6 @@
export interface Template {
id: string
name: string
operation: 'copy' | 'sync' | 'move' | 'delete' | 'purge'
options: Record<string, any>
}