diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-08-27 00:52:39 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-08-27 00:52:39 +0200 |
| commit | adc8cb37fcec21afac848b1e5dd724394c344050 (patch) | |
| tree | 9157bc1973840b00a96912d42f6741352abedbc4 /apps/web/src/stores | |
| parent | b459b46802a760a4a81ce91fdf24390e07375fb0 (diff) | |
| download | opencut-adc8cb37fcec21afac848b1e5dd724394c344050.tar.gz | |
another huge refactor
Diffstat (limited to 'apps/web/src/stores')
| -rw-r--r-- | apps/web/src/stores/text-properties-store.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/web/src/stores/text-properties-store.ts b/apps/web/src/stores/text-properties-store.ts new file mode 100644 index 00000000..b3ce3689 --- /dev/null +++ b/apps/web/src/stores/text-properties-store.ts @@ -0,0 +1,33 @@ +import { create } from "zustand";
+import { persist } from "zustand/middleware";
+
+export type TextPropertiesTab = "transform" | "style";
+
+export interface TextPropertiesTabMeta {
+ value: TextPropertiesTab;
+ label: string;
+}
+
+export const TEXT_PROPERTIES_TABS: ReadonlyArray<TextPropertiesTabMeta> = [
+ { value: "transform", label: "Transform" },
+ { value: "style", label: "Style" },
+] as const;
+
+export function isTextPropertiesTab(value: string): value is TextPropertiesTab {
+ return TEXT_PROPERTIES_TABS.some((t) => t.value === value);
+}
+
+interface TextPropertiesState {
+ activeTab: TextPropertiesTab;
+ setActiveTab: (tab: TextPropertiesTab) => void;
+}
+
+export const useTextPropertiesStore = create<TextPropertiesState>()(
+ persist(
+ (set) => ({
+ activeTab: "transform",
+ setActiveTab: (tab) => set({ activeTab: tab }),
+ }),
+ { name: "text-properties" }
+ )
+);
|
