@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
71 lines (70 loc) • 2.5 kB
TypeScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { SmartBoxMode, SegmentedButtonProps } from '../interfaces/index.js';
import * as React from 'react';
/**
* Represents a minimal mode configuration for the segmented control.
*
* @hidden
*/
export interface SmartBoxModeConfig {
/**
* Specifies whether the mode is enabled.
*/
enabled?: boolean;
}
/**
* Represents the props for the useSmartBoxSegmentedControl hook.
*
* @hidden
*/
export interface UseSmartBoxSegmentedControlProps {
/**
* The search mode configuration.
*/
searchMode: SmartBoxModeConfig | null;
/**
* The semantic search mode configuration.
*/
semanticSearchMode: SmartBoxModeConfig | null;
/**
* The AI assistant mode configuration.
*/
aiAssistantMode: SmartBoxModeConfig | null;
/**
* The currently selected view mode.
*/
selectedView: SmartBoxMode | null;
/**
* The last selected search mode (either 'search' or 'semanticSearch').
* Used to restore the previous search mode when switching back from AI Assistant.
*/
lastSearchMode: SmartBoxMode | null;
/**
* Callback function to update the selected view state.
*/
setSelectedViewState: (view: SmartBoxMode) => void;
/**
* Callback function to update the input value.
*/
setInputValue: React.Dispatch<React.SetStateAction<string>>;
}
/**
* Hook to generate segmented control buttons for switching between SmartBox modes.
*
* This hook creates the button configuration for the segmented control that allows
* users to switch between Search and AI Assistant modes. When both search modes
* (standard and semantic) are available, the Search button dynamically shows the
* appropriate icon based on the last selected search mode.
*
* @param props - The hook properties.
* @returns An array of segmented button props for the mode switcher.
*
* @hidden
*/
export declare function useSmartBoxSegmentedControl({ searchMode, semanticSearchMode, aiAssistantMode, selectedView, lastSearchMode, setSelectedViewState, setInputValue }: UseSmartBoxSegmentedControlProps): SegmentedButtonProps[];