Files
voicebox/app/src/stores/uiStore.ts
T
Jamie Pine 98cfe2dc5a Refactor App layout and enhance UI components for better usability
- Changed the default active tab in the App component from 'profiles' to 'main'.
- Improved the layout of the main content area to better accommodate different views, including profiles, generation forms, and history.
- Updated Sidebar component to reflect the new tab structure with a 'main' tab.
- Enhanced the GenerationForm to utilize the selected profile from the UI store, improving user feedback when no profile is selected.
- Added a new CircleButton component for better icon button interactions.
- Adjusted styles in various components for improved responsiveness and visual consistency.
2026-01-25 14:44:42 -08:00

47 lines
1.2 KiB
TypeScript

import { create } from 'zustand';
interface UIStore {
// Sidebar
sidebarOpen: boolean;
setSidebarOpen: (open: boolean) => void;
// Modals
profileDialogOpen: boolean;
setProfileDialogOpen: (open: boolean) => void;
editingProfileId: string | null;
setEditingProfileId: (id: string | null) => void;
generationDialogOpen: boolean;
setGenerationDialogOpen: (open: boolean) => void;
// Selected profile for generation
selectedProfileId: string | null;
setSelectedProfileId: (id: string | null) => void;
// Theme
theme: 'light' | 'dark';
setTheme: (theme: 'light' | 'dark') => void;
}
export const useUIStore = create<UIStore>((set) => ({
sidebarOpen: true,
setSidebarOpen: (open) => set({ sidebarOpen: open }),
profileDialogOpen: false,
setProfileDialogOpen: (open) => set({ profileDialogOpen: open }),
editingProfileId: null,
setEditingProfileId: (id) => set({ editingProfileId: id }),
generationDialogOpen: false,
setGenerationDialogOpen: (open) => set({ generationDialogOpen: open }),
selectedProfileId: null,
setSelectedProfileId: (id) => set({ selectedProfileId: id }),
theme: 'light',
setTheme: (theme) => {
set({ theme });
document.documentElement.classList.toggle('dark', theme === 'dark');
},
}));