aboutsummaryrefslogtreecommitdiff
path: root/src/stores/useSettingsStore.ts
diff options
context:
space:
mode:
authorzwlucas <lucas.fariamo08@gmail.com>2026-06-05 20:52:54 +0000
committerzwlucas <lucas.fariamo08@gmail.com>2026-06-05 20:52:54 +0000
commit09f964451d7d92e9891430ec4595c1276d486aab (patch)
tree28da4483f5c28924a8c47fceb648b1baebe88224 /src/stores/useSettingsStore.ts
downloadyace-09f964451d7d92e9891430ec4595c1276d486aab.tar.gz
yace-09f964451d7d92e9891430ec4595c1276d486aab.zip
feat: uploadHEADmaster
Signed-off-by: zwlucas <lucas.fariamo08@gmail.com>
Diffstat (limited to 'src/stores/useSettingsStore.ts')
-rw-r--r--src/stores/useSettingsStore.ts34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/stores/useSettingsStore.ts b/src/stores/useSettingsStore.ts
new file mode 100644
index 0000000..7f2be4f
--- /dev/null
+++ b/src/stores/useSettingsStore.ts
@@ -0,0 +1,34 @@
+import { create } from 'zustand'
+import { persist } from 'zustand/middleware'
+
+interface SettingsState {
+ fontSize: number
+ tabSize: number
+ fontFamily: string
+ wordWrap: boolean
+ lineNumbers: boolean
+ ruler: boolean
+ rulerColumn: number
+ autoSave: boolean
+ autoSaveDelay: number
+
+ set: <K extends keyof SettingsState>(key: K, value: SettingsState[K]) => void
+}
+
+export const useSettingsStore = create<SettingsState>()(
+ persist(
+ (set) => ({
+ fontSize: 14,
+ tabSize: 2,
+ fontFamily: 'JetBrains Mono',
+ wordWrap: true,
+ lineNumbers: true,
+ ruler: true,
+ rulerColumn: 80,
+ autoSave: false,
+ autoSaveDelay: 2000,
+ set: (key, value) => set({ [key]: value }),
+ }),
+ { name: 'yace-settings' }
+ )
+)