Skip to content

Commit

Permalink
Enhance AIChat and Sidebar components by integrating context file sup…
Browse files Browse the repository at this point in the history
…port; update styles for improved user experience and responsiveness. Add current page display and file context features in AIChat, and refactor Sidebar to utilize new mock data for context files.
  • Loading branch information
trheyi committed Dec 12, 2024
1 parent f976a7f commit d05ca92
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 247 deletions.
4 changes: 3 additions & 1 deletion packages/xgen/layouts/components/Neo/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Plus, X } from 'phosphor-react'
import { useState } from 'react'

import AIChat from '../components/AIChat'
import { mockMessages } from './mock'
import { mockMessages, mockContextFiles } from './mock'
import styles from './index.less'
import type { IPropsNeo } from '../../../types'

Expand All @@ -21,6 +21,8 @@ const Index = (props: IPropsNeo) => {
messages={messages}
onSend={handleSend}
title='AI Assistant'
currentPage={'Form/Index'}
contextFiles={mockContextFiles}
onNew={() => {
/* handle new */
}}
Expand Down
18 changes: 18 additions & 0 deletions packages/xgen/layouts/components/Neo/Sidebar/mock.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
export const mockContextFiles = [
{
name: 'document.pdf',
type: 'PDF',
thumbUrl: undefined
},
{
name: 'screenshot.png',
type: 'IMG',
thumbUrl: 'https://placehold.co/60/000000/FFF'
},
{
name: 'very-long-filename-example.txt',
type: 'TXT',
thumbUrl: undefined
}
]

export const mockMessages = [
{
role: 'assistant',
Expand Down
Loading

0 comments on commit d05ca92

Please sign in to comment.