11import { useState , useCallback , useEffect } from 'react' ;
22import {
3- Title1 ,
4- Subtitle1 ,
5- Divider ,
3+ Text ,
4+ Avatar ,
65 tokens ,
76} from '@fluentui/react-components' ;
8- import {
9- Sparkle24Regular ,
10- } from '@fluentui/react-icons' ;
117import { v4 as uuidv4 } from 'uuid' ;
128
139import { ChatPanel } from './components/ChatPanel' ;
@@ -21,6 +17,17 @@ interface UserInfo {
2117 is_authenticated : boolean ;
2218}
2319
20+ // Contoso logo SVG component
21+ function ContosoLogo ( ) {
22+ return (
23+ < svg width = "28" height = "28" viewBox = "0 0 28 28" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
24+ < path d = "M14 0L28 14L14 28L0 14L14 0Z" fill = "#0078D4" />
25+ < path d = "M14 4L24 14L14 24L4 14L14 4Z" fill = "#50E6FF" />
26+ < path d = "M14 8L20 14L14 20L8 14L14 8Z" fill = "white" />
27+ </ svg >
28+ ) ;
29+ }
30+
2431function App ( ) {
2532 const [ conversationId , setConversationId ] = useState < string > ( ( ) => uuidv4 ( ) ) ;
2633 const [ userId , setUserId ] = useState < string > ( '' ) ;
@@ -349,42 +356,46 @@ function App() {
349356 }
350357 } , [ confirmedBrief , selectedProducts , conversationId ] ) ;
351358
359+ // Get user initials for avatar
360+ const getUserInitials = ( ) => {
361+ if ( ! userId ) return 'U' ;
362+ // If we have a name, use first letter of first and last name
363+ const parts = userId . split ( '@' ) [ 0 ] . split ( '.' ) ;
364+ if ( parts . length >= 2 ) {
365+ return ( parts [ 0 ] [ 0 ] + parts [ parts . length - 1 ] [ 0 ] ) . toUpperCase ( ) ;
366+ }
367+ return userId [ 0 ] . toUpperCase ( ) ;
368+ } ;
369+
352370 return (
353371 < div className = "app-container" >
354372 { /* Header */ }
355373 < header style = { {
356374 display : 'flex' ,
357375 alignItems : 'center' ,
358- gap : '12px' ,
359- padding : '16px 0' ,
360- marginBottom : '8px'
376+ justifyContent : 'space-between' ,
377+ padding : '12px 24px' ,
378+ borderBottom : `1px solid ${ tokens . colorNeutralStroke2 } ` ,
379+ backgroundColor : tokens . colorNeutralBackground1 ,
361380 } } >
362- < Sparkle24Regular style = { { color : tokens . colorBrandForeground1 } } />
363- < div >
364- < Title1 > Content Generation Accelerator</ Title1 >
365- < Subtitle1 style = { { color : tokens . colorNeutralForeground3 } } >
366- AI-powered marketing content creation
367- </ Subtitle1 >
381+ < div style = { { display : 'flex' , alignItems : 'center' , gap : '10px' } } >
382+ < ContosoLogo />
383+ < Text weight = "semibold" size = { 500 } style = { { color : tokens . colorNeutralForeground1 } } >
384+ Contoso
385+ </ Text >
368386 </ div >
387+ < Avatar
388+ name = { userId || 'User' }
389+ initials = { getUserInitials ( ) }
390+ color = "colorful"
391+ size = { 36 }
392+ />
369393 </ header >
370394
371- < Divider />
372-
373395 { /* Main Content */ }
374- < div className = "main-content" style = { { marginTop : '16px' } } >
375- { /* Chat History Sidebar */ }
376- < div className = "history-panel" >
377- < ChatHistory
378- currentConversationId = { conversationId }
379- currentMessages = { messages }
380- onSelectConversation = { handleSelectConversation }
381- onNewConversation = { handleNewConversation }
382- refreshTrigger = { historyRefreshTrigger }
383- />
384- </ div >
385-
386- { /* Chat Panel - now includes inline product selector and content preview */ }
387- < div className = "chat-panel" style = { { flex : 1 } } >
396+ < div className = "main-content" >
397+ { /* Chat Panel - main area */ }
398+ < div className = "chat-panel" >
388399 < ChatPanel
389400 messages = { messages }
390401 onSendMessage = { handleSendMessage }
@@ -401,6 +412,17 @@ function App() {
401412 onRegenerateContent = { handleGenerateContent }
402413 />
403414 </ div >
415+
416+ { /* Chat History Sidebar - RIGHT side */ }
417+ < div className = "history-panel" >
418+ < ChatHistory
419+ currentConversationId = { conversationId }
420+ currentMessages = { messages }
421+ onSelectConversation = { handleSelectConversation }
422+ onNewConversation = { handleNewConversation }
423+ refreshTrigger = { historyRefreshTrigger }
424+ />
425+ </ div >
404426 </ div >
405427 </ div >
406428 ) ;
0 commit comments