mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-17 22:00:40 -07:00
- 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.
47 lines
1.2 KiB
TypeScript
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');
|
|
},
|
|
}));
|