mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
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).
26 lines
715 B
TypeScript
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>
|
|
)
|
|
})
|