/**
 * Unified summary provider hook.
 * Delegates to either `useSummaryPolling` (aiSummary) or `useSmartFollowDetail` (smartFollowDetail)
 * based on the `mode` parameter.
 *
 * Both hooks are always called to satisfy rules-of-hooks;
 * the inactive hook receives `recordId: undefined` and becomes a no-op.
 */
import { useSummaryPolling } from './use-summary-polling';
import { useSmartFollowDetail } from './use-smart-follow-detail';
export function useSummaryProvider({ mode, recordId, tableId, viewData, rowData, initialSummary, recordData, columnDefinitions, conversationId, enabled, bizRequestConfig, }) {
    const aiResult = useSummaryPolling({
        recordId: mode === 'aiSummary' ? recordId : undefined,
        tableId,
        rowData: rowData !== null && rowData !== void 0 ? rowData : {},
        initialSummary,
        viewData,
        enabled: mode === 'aiSummary' ? enabled !== false : true,
        bizRequestConfig,
    });
    const sfResult = useSmartFollowDetail({
        tableId,
        recordId: mode === 'smartFollowDetail' ? recordId : undefined,
        recordData: mode === 'smartFollowDetail' ? recordData : null,
        columnDefinitions: columnDefinitions !== null && columnDefinitions !== void 0 ? columnDefinitions : [],
        conversationId: conversationId !== null && conversationId !== void 0 ? conversationId : null,
        viewData,
        enabled: mode === 'smartFollowDetail' ? enabled : undefined,
    });
    return mode === 'aiSummary' ? { ...aiResult, gmtModified: undefined } : sfResult;
}
