import { useSession } from "../../contexts/session"; import { useWindows } from "../../contexts/windows"; const useNextFocusable = (id: string): string => { const { stackOrder = [] } = useSession(); const { windows } = useWindows(); const nextFocusableId = stackOrder.find( (stackId) => stackId !== id && !windows?.[stackId]?.minimized ); return nextFocusableId || ""; }; export default useNextFocusable;