Files
hapi/web/src/components/ChatInput/FloatingOverlay.tsx
T
weishu ec3a849cbd 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).
2025-12-17 09:13:15 +08:00

26 lines
715 B
TypeScript

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>
)
})