mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
feat: refactor ChatInput with autocomplete, suggestion management, and settings integration
Extract word detection and suggestion logic into reusable utilities and hooks. Add FloatingOverlay and Autocomplete components for intelligent input assistance. Integrate settings panel and abort button directly into ChatInput component. Simplify SessionHeader by removing settings dialog (now in ChatInput).
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { memo, ReactNode } from 'react'
|
||||
|
||||
interface FloatingOverlayProps {
|
||||
children: ReactNode
|
||||
maxHeight?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* A floating panel container with shadow and rounded corners
|
||||
* Used for autocomplete suggestions and settings panels
|
||||
*/
|
||||
export const FloatingOverlay = memo(function FloatingOverlay(props: FloatingOverlayProps) {
|
||||
const { children, maxHeight = 240 } = props
|
||||
|
||||
return (
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border border-[var(--app-divider)] bg-[var(--app-bg)] shadow-lg"
|
||||
style={{ maxHeight }}
|
||||
>
|
||||
<div className="overflow-y-auto" style={{ maxHeight }}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user