diff --git a/frontend/src/api/hooks.ts b/frontend/src/api/hooks.ts index cf1f5fb..5b6367f 100644 --- a/frontend/src/api/hooks.ts +++ b/frontend/src/api/hooks.ts @@ -1295,3 +1295,4 @@ export function useMoveContactToFolder() { }, }); } + diff --git a/frontend/src/components/layout/AISidebar.tsx b/frontend/src/components/layout/AISidebar.tsx index 869b5a8..ff644cb 100644 --- a/frontend/src/components/layout/AISidebar.tsx +++ b/frontend/src/components/layout/AISidebar.tsx @@ -5,6 +5,8 @@ import { SuggestionList } from '@/components/ai/SuggestionSidebar'; import { createSession, fetchSessions } from '@/api/ai'; import { useUIStore } from '@/store/uiStore'; import { useTranslation } from 'react-i18next'; +import { useUsers, useGroups } from '@/api/hooks'; +import { Avatar } from '@/components/ui/Avatar'; const robotIcon = (className: string) => ( @@ -24,6 +26,18 @@ const bulbIcon = (className: string) => ( ); +const teamIcon = (className: string) => ( + + + +); + +const chatBubbleIcon = (className: string) => ( + + + +); + const chevronRightIcon = ( @@ -31,12 +45,82 @@ const chevronRightIcon = ( ); interface TabDef { - key: 'proactive' | 'chat' | 'notifications'; + key: 'proactive' | 'chat' | 'notifications' | 'team' | 'chatroom'; label: string; icon: (cls: string) => React.ReactNode; testId: string; } +function TeamPanel() { + const { data: usersData, isLoading: usersLoading } = useUsers(); + const { data: groupsData, isLoading: groupsLoading } = useGroups(); + const users: any[] = usersData?.items || []; + const groups: any[] = groupsData?.items || []; + + return ( + + + Mitarbeiter + {usersLoading ? ( + Laden... + ) : users.length === 0 ? ( + Keine Mitarbeiter + ) : ( + + {users.map((u) => ( + + + + + + + {u.name} + {u.email} + + {u.role} + + ))} + + )} + + + Gruppen + {groupsLoading ? ( + Laden... + ) : groups.length === 0 ? ( + Keine Gruppen + ) : ( + + {groups.map((g) => ( + + + + + + + + {g.name} + {g.description && {g.description}} + + + ))} + + )} + + + ); +} + +function ChatPanel() { + return ( + + + Chat-Sidebar - Coming Soon + + + ); +} + export function AISidebar() { const { t } = useTranslation(); const { aiSidebarCollapsed, toggleAISidebar, aiSidebarTab, setAISidebarTab, notifications, removeNotification } = useUIStore(); @@ -65,6 +149,8 @@ export function AISidebar() { { key: 'chat', label: 'KI Chat', icon: robotIcon, testId: 'ai-sidebar-tab-chat' }, { key: 'proactive', label: 'Live KI', icon: bulbIcon, testId: 'ai-sidebar-tab-proactive' }, { key: 'notifications', label: t('topbar.notifications'), icon: bellIcon, testId: 'ai-sidebar-tab-notifications' }, + { key: 'team', label: 'Team', icon: teamIcon, testId: 'ai-sidebar-tab-team' }, + { key: 'chatroom', label: 'Chat', icon: chatBubbleIcon, testId: 'ai-sidebar-tab-chatroom' }, ]; const activeTab = tabs.find((tab) => tab.key === aiSidebarTab) || tabs[0]; @@ -124,6 +210,12 @@ export function AISidebar() { ); } + if (aiSidebarTab === 'team') { + return ; + } + if (aiSidebarTab === 'chatroom') { + return ; + } // chat tab if (loading) { return ( diff --git a/frontend/src/store/uiStore.ts b/frontend/src/store/uiStore.ts index 7a9dbf0..bd2410b 100644 --- a/frontend/src/store/uiStore.ts +++ b/frontend/src/store/uiStore.ts @@ -2,7 +2,7 @@ import { create } from 'zustand'; export type Theme = 'light' | 'dark' | 'system'; export type Locale = 'de' | 'en'; -export type AISidebarTab = 'proactive' | 'chat' | 'notifications'; +export type AISidebarTab = 'proactive' | 'chat' | 'notifications' | 'team' | 'chatroom'; export interface Toast { id: string;
Laden...
Keine Mitarbeiter
{u.name}
{u.email}
Keine Gruppen
{g.name}
{g.description}
Chat-Sidebar - Coming Soon