import { useSetting } from '../../state/hooks/settings'; import { settingsAtom } from '../../state/settings'; import { useCall } from './useCall'; import { CallState } from './types'; /** * Hook to determine if the call panel should be rendered docked * Returns true if there's an active call AND the panel is set to docked mode */ export function useIsCallDocked(): boolean { const { activeCall } = useCall(); const [isDocked] = useSetting(settingsAtom, 'isCallPanelDocked'); const hasActiveCall = activeCall && (activeCall.state === CallState.Connecting || activeCall.state === CallState.Connected); return Boolean(hasActiveCall && isDocked); }