UNPKG

@memori.ai/memori-react

Version:

[![npm version](https://img.shields.io/github/package-json/v/memori-ai/memori-react)](https://www.npmjs.com/package/@memori.ai/memori-react) ![Tests](https://github.com/memori-ai/memori-react/workflows/CI/badge.svg?branch=main) ![TypeScript Support](https

516 lines 28.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const Drawer_1 = tslib_1.__importDefault(require("../ui/Drawer")); const react_i18next_1 = require("react-i18next"); const react_1 = require("react"); const Card_1 = tslib_1.__importDefault(require("../ui/Card")); const Button_1 = tslib_1.__importDefault(require("../ui/Button")); const Chat_1 = tslib_1.__importDefault(require("../icons/Chat")); const utils_1 = require("../../helpers/utils"); const react_2 = require("@headlessui/react"); const debounce_1 = tslib_1.__importDefault(require("lodash/debounce")); const Spin_1 = tslib_1.__importDefault(require("../ui/Spin")); const Chat_2 = tslib_1.__importDefault(require("../Chat/Chat")); const Download_1 = tslib_1.__importDefault(require("../icons/Download")); const Message_1 = tslib_1.__importDefault(require("../icons/Message")); const Select_1 = tslib_1.__importDefault(require("../ui/Select")); const ITEMS_PER_PAGE = 8; const DEBOUNCE_DELAY = 300; const calculateTitle = (lines) => { const userMessages = lines.filter(line => line.inbound); if (userMessages.length === 0) return ''; const insignificantPhrases = [ 'hello', 'hi', 'hey', 'good morning', 'good afternoon', 'good evening', 'thanks', 'thank you', 'thx', 'tnx', 'ty', 'thanks!', 'thank you!', 'ok', 'okay', 'k', 'yes', 'no', 'yep', 'nope', 'yeah', 'nah', 'good', 'great', 'nice', 'cool', 'awesome', 'perfect', 'excellent', 'bye', 'goodbye', 'see you', 'see ya', 'later', 'good night', 'how are you', 'how are you doing', "what's up", 'sup', 'please', 'pls', 'sorry', 'excuse me', 'pardon', 'i see', 'i understand', 'got it', 'gotcha', 'understood', 'continue', 'go on', 'tell me more', 'more', 'next', 'start', 'begin', "let's start", "let's begin", 'help', 'can you help', 'i need help', 'test', 'testing', 'test message', '?', '??', '???', '!', '!!', '!!!', '...', '..', '.', 'a', 'an', 'the', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for', 'of', 'with', 'by', 'ciao', 'salve', 'buongiorno', 'buonasera', 'buonanotte', 'grazie', 'grazie mille', 'grazie!', 'grazie mille!', 'thx', 'tnx', 'ok', 'va bene', 'va bene così', 'perfetto', 'ottimo', 'bene', 'sì', 'si', 'no', 'certo', 'certamente', 'assolutamente', 'arrivederci', 'a presto', 'a dopo', 'ci vediamo', 'addio', 'come stai', 'come va', 'tutto bene', 'che succede', 'per favore', 'per piacere', 'scusa', 'scusami', 'mi dispiace', 'capisco', 'ho capito', 'capito', 'perfetto', 'continua', 'vai avanti', 'dimmi di più', 'altro', 'altro ancora', 'inizia', 'iniziamo', 'comincia', 'cominciamo', 'aiuto', 'puoi aiutarmi', 'ho bisogno di aiuto', 'test', 'prova', 'messaggio di prova', '?', '??', '???', '!', '!!', '!!!', '...', '..', '.', 'un', 'una', 'il', 'la', 'gli', 'le', 'e', 'o', 'ma', 'in', 'su', 'a', 'per', 'di', 'con', 'da', ]; const calculateSignificanceScore = (message) => { const cleanMessage = message.toLowerCase().trim(); if (insignificantPhrases.includes(cleanMessage)) { return 0; } const wordCount = cleanMessage .split(/\s+/) .filter(word => word.length > 0).length; if (wordCount < 3) { return 0.1; } if (cleanMessage.length < 5) { return 0.1; } const isQuestion = /\?$/.test(cleanMessage) || /^(what|how|why|when|where|who|which|can|could|would|will|do|does|did|is|are|was|were)/.test(cleanMessage) || /^(cosa|come|perché|perche|quando|dove|chi|quale|quali|può|puo|potrebbe|vorrebbe|sarà|sara|fa|fai|fanno|è|e|sono|era|erano)/.test(cleanMessage); let score = 0.5; if (isQuestion) score += 0.3; if (wordCount > 5) score += 0.2; if (wordCount > 10) score += 0.2; if (wordCount > 20) score -= 0.1; if (/\d/.test(cleanMessage)) score += 0.1; if (/[A-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸ][a-zàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]+/.test(message)) score += 0.1; return Math.min(score, 1.0); }; const scoredMessages = userMessages.map((msg, index) => { const cleanText = (0, utils_1.stripHTML)(msg.text || ''); const score = calculateSignificanceScore(cleanText); return { text: cleanText, score, index, originalIndex: index, }; }); scoredMessages.sort((a, b) => { if (Math.abs(a.score - b.score) < 0.1) { return a.index - b.index; } return b.score - a.score; }); let bestMessage = scoredMessages[0]; if (bestMessage.score < 0.3) { const betterMessage = scoredMessages.find(msg => msg.score > 0.1); if (betterMessage) { bestMessage = betterMessage; } } if (bestMessage.score < 0.2) { const meaningfulMessages = scoredMessages .filter(msg => msg.score > 0.1) .slice(0, 3) .sort((a, b) => a.index - b.index); if (meaningfulMessages.length > 1) { const combinedText = meaningfulMessages .map(msg => msg.text) .join(' - ') .substring(0, 80); return combinedText.length > 80 ? `${combinedText}...` : combinedText; } } const title = bestMessage.text; const maxLength = 100; if (title.length > maxLength) { const truncated = title.substring(0, maxLength); const lastSpace = truncated.lastIndexOf(' '); if (lastSpace > maxLength * 0.7) { return `${truncated.substring(0, lastSpace)}...`; } return `${truncated}...`; } return title; }; const downloadFile = (text, filename) => { const data = new Blob([text], { type: 'text/plain' }); const url = URL.createObjectURL(data); const element = document.createElement('a'); element.setAttribute('href', url); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); }; const ChatHistoryDrawer = ({ open, onClose, apiClient, sessionId, memori, resumeSession, baseUrl, apiUrl, history, loginToken, }) => { const { t } = (0, react_i18next_1.useTranslation)(); const { getUserChatLogsByTokenPaged } = apiClient.chatLogs; const textCurrentChat = `${t('write_and_speak.conversationStartedLabel')} ${new Intl.DateTimeFormat('it', { dateStyle: 'short', timeStyle: 'short', }).format(new Date())}\n\n`.concat(history .map(m => `${m.fromUser ? 'YOU' : memori.name}: ${m.text}`) .join('\n')); const [chatLogs, setChatLogs] = (0, react_1.useState)([]); const [selectedChatLog, setSelectedChatLog] = (0, react_1.useState)(null); const [currentPage, setCurrentPage] = (0, react_1.useState)(1); const [indexPage, setIndexPage] = (0, react_1.useState)(0); const [searchText, setSearchText] = (0, react_1.useState)(''); const [isLoading, setIsLoading] = (0, react_1.useState)(false); const [error, setError] = (0, react_1.useState)(null); const [sortOrder, setSortOrder] = (0, react_1.useState)('desc'); const [dateRange, setDateRange] = (0, react_1.useState)('all'); const [totalItems, setTotalItems] = (0, react_1.useState)(0); const [totalPages, setTotalPages] = (0, react_1.useState)(0); const formatDateForAPI = (date) => { const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0'); const hours = String(date.getHours()).padStart(2, '0'); const minutes = String(date.getMinutes()).padStart(2, '0'); const seconds = String(date.getSeconds()).padStart(2, '0'); const milliseconds = String(date.getMilliseconds()).padStart(3, '0'); return `${year}${month}${day}${hours}${minutes}${seconds}${milliseconds}`; }; const formatDateRangeForAPI = (dateRange) => { if (dateRange === 'today') { const now = new Date(); const yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1); const dateFrom = formatDateForAPI(yesterday); const dateTo = formatDateForAPI(now); return { dateFrom, dateTo }; } if (dateRange === 'yesterday') { const now = new Date(); const yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1); const dayBeforeYesterday = new Date(yesterday.getFullYear(), yesterday.getMonth(), yesterday.getDate() - 2); const dateFrom = formatDateForAPI(dayBeforeYesterday); const dateTo = formatDateForAPI(yesterday); return { dateFrom, dateTo }; } if (dateRange === 'last_7_days') { const now = new Date(); const sevenDaysAgo = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7); const dateFrom = formatDateForAPI(sevenDaysAgo); const dateTo = formatDateForAPI(now); return { dateFrom, dateTo }; } if (dateRange === 'last_30_days') { const now = new Date(); const thirtyDaysAgo = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 30); const dateFrom = formatDateForAPI(thirtyDaysAgo); const dateTo = formatDateForAPI(now); return { dateFrom, dateTo }; } }; const fetchChatLogs = (0, react_1.useCallback)(async (dateRangeValue = 'all') => { var _a, _b, _c; if (!loginToken) { setError(t('errorFetchingSession') || 'Login token required to fetch chat history'); return; } const calculatedIndex = ITEMS_PER_PAGE * (currentPage - 1); setIndexPage(calculatedIndex); setIsLoading(true); setError(null); let response; try { if (dateRangeValue === 'all') { response = await getUserChatLogsByTokenPaged(loginToken, (_a = memori.engineMemoriID) !== null && _a !== void 0 ? _a : '', calculatedIndex, ITEMS_PER_PAGE, undefined, undefined, false); } else { const { dateFrom, dateTo } = (_b = formatDateRangeForAPI(dateRangeValue)) !== null && _b !== void 0 ? _b : {}; response = await getUserChatLogsByTokenPaged(loginToken, (_c = memori.engineMemoriID) !== null && _c !== void 0 ? _c : '', calculatedIndex, ITEMS_PER_PAGE, dateFrom !== null && dateFrom !== void 0 ? dateFrom : undefined, dateTo !== null && dateTo !== void 0 ? dateTo : undefined, false); } const res = response; const sortedChatLogs = res.chatLogs.sort((a, b) => { const dateA = Math.max(...a.lines.map((l) => new Date(l.timestamp).getTime())); const dateB = Math.max(...b.lines.map((l) => new Date(l.timestamp).getTime())); return sortOrder === 'desc' ? dateB - dateA : dateA - dateB; }); setChatLogs(sortedChatLogs); setTotalItems(res.count || sortedChatLogs.length); setTotalPages(Math.ceil((res.count || sortedChatLogs.length) / ITEMS_PER_PAGE)); } catch (err) { setError(t('errorFetchingSession') || 'Error loading chat history'); console.error('Error fetching chat logs:', err); } finally { setIsLoading(false); } }, [loginToken, memori.engineMemoriID, currentPage, sortOrder, apiUrl]); (0, react_1.useEffect)(() => { if (open) { setCurrentPage(1); setIndexPage(0); } }, [open]); (0, react_1.useEffect)(() => { if (open) { setCurrentPage(1); setIndexPage(0); } }, [sortOrder, dateRange, open]); (0, react_1.useEffect)(() => { if (open && currentPage > 0) { fetchChatLogs(dateRange); } }, [currentPage, dateRange, fetchChatLogs, open]); const debouncedSearch = (0, react_1.useMemo)(() => (0, debounce_1.default)((value) => setSearchText(value), DEBOUNCE_DELAY), []); const paginatedChatLogs = chatLogs; const handleResumeChat = async () => { if (selectedChatLog) { resumeSession(selectedChatLog); onClose(); } }; const handleExportChat = (chatLog, e) => { e.stopPropagation(); const text = `${t('write_and_speak.conversationStartedLabel')} ${new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short', }).format(new Date())}\n\n`.concat(chatLog.lines .map(line => `${line.inbound ? 'YOU' : memori.name}: ${line.text}`) .join('\n')); downloadFile(text, `${memori.name.replace(/\W+/g, '-')}-chat-${chatLog.chatLogID.substring(0, 4)}.txt`); }; const formatDate = (timestamp) => { return new Intl.DateTimeFormat(navigator.language, { dateStyle: 'medium', timeStyle: 'short', }).format(new Date(timestamp)); }; const escapeUnderScore = (value) => { return value.replace(/_/g, ' '); }; const renderContent = () => { if (isLoading) { return ((0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--loading", children: [(0, jsx_runtime_1.jsx)(Spin_1.default, { spinning: true, primary: true, className: "memori-chat-history-drawer--loading--spinner" }), (0, jsx_runtime_1.jsx)("p", { className: "memori-chat-history-drawer--loading--text", children: t('write_and_speak.loadingChatHistory') || 'Loading chat history...' })] })); } if (error) { return ((0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--error", children: (0, jsx_runtime_1.jsx)("p", { children: error }) })); } if (!chatLogs.length) { return ((0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--empty", children: [(0, jsx_runtime_1.jsx)(Chat_1.default, { className: "memori-chat-history-drawer--empty--icon" }), (0, jsx_runtime_1.jsx)("p", { className: "memori-chat-history-drawer--empty--text", children: t('write_and_speak.noChatHistoryAvailable') || 'No chat history available' })] })); } if (chatLogs.length === 0) { return ((0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--no-results", children: (0, jsx_runtime_1.jsx)("p", { children: t('write_and_speak.noResultsFound', { searchText: searchText || '', }) || 'No results found' }) })); } return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("ul", { className: "memori-chat-history-drawer--list", children: paginatedChatLogs.map((chatLog) => { const lastMessageDate = Math.max(...chatLog.lines.map(line => new Date(line.timestamp).getTime())); return ((0, jsx_runtime_1.jsx)(Card_1.default, { hoverable: true, onClick: async () => { if ((selectedChatLog === null || selectedChatLog === void 0 ? void 0 : selectedChatLog.chatLogID) === chatLog.chatLogID) { setSelectedChatLog(null); return; } setSelectedChatLog(chatLog); }, className: `memori-chat-history-drawer--card ${(selectedChatLog === null || selectedChatLog === void 0 ? void 0 : selectedChatLog.chatLogID) === chatLog.chatLogID ? 'memori-chat-history-drawer--card--selected' : ''}`, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--header", children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--card--header--content", children: [(0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--header--icon-wrapper", children: (0, jsx_runtime_1.jsx)(Message_1.default, { className: "memori-chat-history-drawer--card--header--icon" }) }), (0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--header--info", children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--card--header--title-wrapper", children: [(0, jsx_runtime_1.jsx)(react_2.Dialog.Title, { as: "h3", className: "memori-chat-history-drawer--card--header--title", children: calculateTitle(chatLog.lines) || 'Chat-' + chatLog.chatLogID.substring(0, 4) }), chatLog.boardOfExperts && ((0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--header--badge", children: "BOE" }))] }) })] }) }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--card--header--meta", children: [(0, jsx_runtime_1.jsxs)("time", { className: "memori-chat-history-drawer--card--header--meta--time", dateTime: new Date(lastMessageDate).toISOString(), children: [(0, jsx_runtime_1.jsx)("svg", { className: "memori-chat-history-drawer--card--header--meta--icon", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) }), formatDate(new Date(lastMessageDate).toISOString())] }), chatLog.lines.some(line => line.media && line.media.filter(m => m.mimeType !== 'text/html' && m.mimeType !== 'text/plain').length > 0) && ((0, jsx_runtime_1.jsxs)("span", { className: "memori-chat-history-drawer--card--header--meta--messages", children: [(0, jsx_runtime_1.jsx)("svg", { className: "memori-chat-history-drawer--card--header--meta--icon", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), chatLog.lines.reduce((acc, line) => { var _a; return acc + (((_a = line.media) === null || _a === void 0 ? void 0 : _a.filter(m => m.mimeType !== 'text/html' && m.mimeType !== 'text/plain').length) || 0); }, 0)] })), (0, jsx_runtime_1.jsxs)("span", { className: "memori-chat-history-drawer--card--header--meta--messages", children: [(0, jsx_runtime_1.jsx)("svg", { className: "memori-chat-history-drawer--card--header--meta--icon", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" }) }), chatLog.lines.length] }), (0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--content--header", children: (0, jsx_runtime_1.jsx)(Button_1.default, { className: "memori-chat-history-drawer--card--content--export-button", onClick: e => handleExportChat(chatLog, e), children: (0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--content--export-button--content", children: (0, jsx_runtime_1.jsx)(Download_1.default, { className: "memori-chat-history-drawer--card--content--export-button--icon" }) }) }) })] }), (selectedChatLog === null || selectedChatLog === void 0 ? void 0 : selectedChatLog.chatLogID) === chatLog.chatLogID && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--card--content", children: [(0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--content--messages", children: (0, jsx_runtime_1.jsx)(Chat_2.default, { baseUrl: baseUrl, apiUrl: apiUrl, memoriTyping: false, showTypingText: false, showAIicon: true, showTranslationOriginal: false, showWhyThisAnswer: false, showCopyButton: false, showInputs: false, history: chatLog.lines.map(line => ({ text: line.text, contextVars: line.contextVars, media: line.media, fromUser: line.inbound, timestamp: line.timestamp, })), memori: memori, sessionID: sessionId, pushMessage: () => { }, simulateUserPrompt: () => { }, setSendOnEnter: () => { }, attachmentsMenuOpen: undefined, setAttachmentsMenuOpen: () => { }, userMessage: '', onChangeUserMessage: () => { }, sendMessage: () => { }, startListening: () => { }, stopListening: () => { }, resetTranscript: () => { }, listening: false, setEnableFocusChatInput: () => { }, stopAudio: () => { }, isHistoryView: true }, `${chatLog.chatLogID}-${chatLog.lines.length}`) }), (0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--card--content--actions", children: (0, jsx_runtime_1.jsx)(Button_1.default, { className: "memori-chat-history-drawer--card--content--resume-button", primary: true, onClick: handleResumeChat, children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--card--content--resume-button--content", children: [(0, jsx_runtime_1.jsx)(Chat_1.default, { className: "memori-chat-history-drawer--card--content--resume-button--icon" }), (0, jsx_runtime_1.jsx)("span", { className: "memori-chat-history-drawer--card--content--resume-button--text", children: t('write_and_speak.resumeButton') || 'Resume chat' })] }) }) })] }))] }) }, chatLog.chatLogID)); }) }), totalPages > 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--pagination", children: [(0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, onClick: () => { setCurrentPage(p => Math.max(1, p - 1)); }, disabled: currentPage === 1, className: "memori-chat-history-drawer--pagination--button", children: t('previous') || 'Previous' }), (0, jsx_runtime_1.jsx)("span", { className: "memori-chat-history-drawer--pagination--info", children: t('write_and_speak.page', { current: currentPage, total: totalPages, }) }), (0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, onClick: () => { setCurrentPage(p => Math.min(totalPages, p + 1)); }, disabled: currentPage === totalPages, className: "memori-chat-history-drawer--pagination--button", children: t('next') || 'Next' })] }))] })); }; return ((0, jsx_runtime_1.jsx)(Drawer_1.default, { className: "memori-chat-history-drawer", open: open, onClose: onClose, title: (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--title-wrapper", style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', width: '100%', }, children: [(0, jsx_runtime_1.jsx)("span", { children: t('write_and_speak.chatHistory') || 'Chat History' }), (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--download-button-wrapper", children: [(0, jsx_runtime_1.jsx)("span", { className: "memori-chat-history-drawer--download-button-wrapper--text", children: t('write_and_speak.downloadChat') || 'Download chat' }), (0, jsx_runtime_1.jsx)(Button_1.default, { primary: true, shape: "circle", className: "memori-chat-history-drawer--download-button", title: t('download') || 'Download chat', icon: (0, jsx_runtime_1.jsx)(Download_1.default, {}), onClick: () => { const fileName = `${memori.name.replace(/\W+/g, '-')}-chat-${new Date().toISOString().split('T')[0]}.txt`; downloadFile(textCurrentChat, fileName); } })] })] }), description: t('write_and_speak.chatHistoryDescription'), children: (0, jsx_runtime_1.jsxs)("div", { className: "memori-chat-history-drawer--content", children: [(0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--toolbar", children: (0, jsx_runtime_1.jsx)("div", { className: "memori-chat-history-drawer--toolbar--actions", children: (0, jsx_runtime_1.jsx)(Select_1.default, { options: [ { label: t('all') || 'All', value: 'all', }, { label: t('today') || 'Today', value: 'today', }, { label: t('yesterday') || 'Yesterday', value: 'yesterday', }, { label: t('last_7_days') || 'Last 7 days', value: 'last_7_days', }, { label: t('last_30_days') || 'Last 30 days', value: 'last_30_days', }, ], value: t(dateRange) || 'All', className: "memori-chat-history-drawer--toolbar--actions--select", onChange: (value) => { setDateRange(value); setCurrentPage(1); } }) }) }), renderContent()] }) })); }; exports.default = ChatHistoryDrawer; //# sourceMappingURL=ChatHistory.js.map