AISidebar: robot icon for AI, move notifications from TopBar to AISidebar with own tab and bell icon
This commit is contained in:
@@ -2,7 +2,7 @@ import { create } from 'zustand';
|
||||
|
||||
export type Theme = 'light' | 'dark' | 'system';
|
||||
export type Locale = 'de' | 'en';
|
||||
export type AISidebarTab = 'proactive' | 'chat';
|
||||
export type AISidebarTab = 'proactive' | 'chat' | 'notifications';
|
||||
|
||||
export interface Toast {
|
||||
id: string;
|
||||
@@ -19,6 +19,7 @@ export interface UIState {
|
||||
aiSidebarCollapsed: boolean;
|
||||
aiSidebarTab: AISidebarTab;
|
||||
toasts: Toast[];
|
||||
notifications: string[];
|
||||
setTheme: (theme: Theme) => void;
|
||||
setLocale: (locale: Locale) => void;
|
||||
toggleSidebar: () => void;
|
||||
@@ -31,6 +32,8 @@ export interface UIState {
|
||||
addToast: (toast: Omit<Toast, 'id'>) => void;
|
||||
removeToast: (id: string) => void;
|
||||
clearToasts: () => void;
|
||||
removeNotification: (index: number) => void;
|
||||
clearNotifications: () => void;
|
||||
}
|
||||
|
||||
let toastIdCounter = 0;
|
||||
@@ -43,6 +46,11 @@ export const useUIStore = create<UIState>((set) => ({
|
||||
aiSidebarCollapsed: true,
|
||||
aiSidebarTab: 'chat',
|
||||
toasts: [],
|
||||
notifications: [
|
||||
'Neuer Kontakt hinzugefügt: Max Mustermann',
|
||||
'Firma aktualisiert: TechCorp GmbH',
|
||||
'Meeting um 14:00 Uhr mit Müller AG',
|
||||
],
|
||||
setTheme: (theme) => {
|
||||
localStorage.setItem('leocrm_theme', theme);
|
||||
set({ theme });
|
||||
@@ -65,4 +73,7 @@ export const useUIStore = create<UIState>((set) => ({
|
||||
removeToast: (id) =>
|
||||
set((s) => ({ toasts: s.toasts.filter((t) => t.id !== id) })),
|
||||
clearToasts: () => set({ toasts: [] }),
|
||||
removeNotification: (index) =>
|
||||
set((s) => ({ notifications: s.notifications.filter((_, i) => i !== index) })),
|
||||
clearNotifications: () => set({ notifications: [] }),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user