/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { useCallback } from 'react';
import { useAppDispatch } from '../contexts/AppDispatchContext.js';
export const useAuthCommand = (settings, appState) => {
    const appDispatch = useAppDispatch();
    const isAuthDialogOpen = appState.openDialogs.auth;
    const openAuthDialog = useCallback(() => {
        appDispatch({ type: 'OPEN_DIALOG', payload: 'auth' });
    }, [appDispatch]);
    const handleAuthSelect = useCallback(async (_selection, _scope) => {
        appDispatch({ type: 'CLOSE_DIALOG', payload: 'auth' });
        appDispatch({ type: 'SET_AUTH_ERROR', payload: null });
    }, [appDispatch]);
    return {
        isAuthDialogOpen,
        openAuthDialog,
        handleAuthSelect,
    };
};
//# sourceMappingURL=useAuthCommand.js.map