use-chat-pane.ts 592 B

12345678910111213
  1. import { useLayoutContext } from '@/shared/context/layout-context'
  2. import useFixedSizeColumn from '@/features/ide-react/hooks/use-fixed-size-column'
  3. import useCollapsiblePanel from '@/features/ide-react/hooks/use-collapsible-panel'
  4. import { useState } from 'react'
  5. export const useChatPane = () => {
  6. const { chatIsOpen: isOpen } = useLayoutContext()
  7. const [resizing, setResizing] = useState(false)
  8. const { fixedPanelRef, handleLayout } = useFixedSizeColumn(isOpen)
  9. useCollapsiblePanel(isOpen, fixedPanelRef)
  10. return { isOpen, fixedPanelRef, handleLayout, resizing, setResizing }
  11. }