UNPKG

@progress/kendo-react-grid

Version:

React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package

103 lines (102 loc) 2.87 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use client"; import * as L from "react"; import { useLocalization as P, useInternationalization as z } from "@progress/kendo-react-intl"; import { lightbulbOutlineIcon as $, clockArrowRotateIcon as f } from "@progress/kendo-svg-icons"; import { smartBoxSuggestedPrompts as l, messages as e, smartBoxPreviouslyAsked as n, smartBoxPreviouslySearched as r, smartBoxSearchModeDescription as B, smartBoxSearchModeText as D, smartBoxSemanticSearchModeDescription as v, smartBoxSemanticSearchModeText as I } from "../../../messages/index.mjs"; function T({ selectedView: p, searchModeEnabled: h, semanticSearchModeEnabled: u, promptSuggestions: d, currentHistory: i, currentHistorySettings: a }) { const o = P(), x = z(), g = o.toLanguageString( l, e[l] ), s = p === "aiAssistant" ? o.toLanguageString( n, e[n] ) : o.toLanguageString( r, e[r] ), M = L.useMemo(() => h && u ? [ { text: o.toLanguageString( D, e[D] ), description: o.toLanguageString( B, e[B] ), selected: p === "search", mode: "search" }, { text: o.toLanguageString( I, e[I] ), description: o.toLanguageString( v, e[v] ), selected: p === "semanticSearch", mode: "semanticSearch" } ] : [], [h, u, p, o]), A = L.useMemo(() => { const m = []; return d.forEach((t, c) => { m.push({ id: `suggestion-${c}`, text: t, group: g, groupSvgIcon: $, isHistoryItem: !1 }); }), i.forEach((t, c) => { m.push({ id: `history-${c}`, text: t.text, description: x.formatDate(t.timestamp, (a == null ? void 0 : a.timestampFormat) || "HH:mm"), group: s, groupSvgIcon: f, isHistoryItem: !0, timestamp: t.timestamp }); }), m; }, [ d, i, g, s, x, a == null ? void 0 : a.timestampFormat ]), F = L.useMemo(() => i.map((m, t) => ({ id: `history-${t}`, text: m.text, description: x.formatDate(m.timestamp, (a == null ? void 0 : a.timestampFormat) || "HH:mm"), group: s, groupSvgIcon: f, isHistoryItem: !0, timestamp: m.timestamp })), [i, s, x, a == null ? void 0 : a.timestampFormat]); return { searchListData: M, aiAssistantListData: A, searchHistoryListData: F, suggestedPromptsLabel: g, historyLabel: s }; } export { T as useSmartBoxListData };