diff --git a/src/renderer/src/components/Avatar/EmojiAvatarWithPicker.tsx b/src/renderer/src/components/Avatar/EmojiAvatarWithPicker.tsx index 6735d86a4..649f619cb 100644 --- a/src/renderer/src/components/Avatar/EmojiAvatarWithPicker.tsx +++ b/src/renderer/src/components/Avatar/EmojiAvatarWithPicker.tsx @@ -1,4 +1,4 @@ -import { Button, Popover, PopoverContent, PopoverTrigger } from '@heroui/react' +import { Button, Popover } from 'antd' import React from 'react' import EmojiPicker from '../EmojiPicker' @@ -10,13 +10,10 @@ type Props = { export const EmojiAvatarWithPicker: React.FC = ({ emoji, onPick }) => { return ( - - - ) } diff --git a/src/renderer/src/components/ConfirmDialog.tsx b/src/renderer/src/components/ConfirmDialog.tsx index 5ac0ae127..a3ffa5e27 100644 --- a/src/renderer/src/components/ConfirmDialog.tsx +++ b/src/renderer/src/components/ConfirmDialog.tsx @@ -1,5 +1,5 @@ -import { Button } from '@heroui/react' -import { CheckIcon, XIcon } from 'lucide-react' +import { CheckOutlined, CloseOutlined } from '@ant-design/icons' +import { Button } from 'antd' import type { FC } from 'react' import { createPortal } from 'react-dom' @@ -28,12 +28,22 @@ const ConfirmDialog: FC = ({ x, y, message, onConfirm, onCancel }) => {
{message}
- - +
diff --git a/src/renderer/src/pages/home/Tabs/AssistantsTab.tsx b/src/renderer/src/pages/home/Tabs/AssistantsTab.tsx index 383319a3b..8c0a1c49b 100644 --- a/src/renderer/src/pages/home/Tabs/AssistantsTab.tsx +++ b/src/renderer/src/pages/home/Tabs/AssistantsTab.tsx @@ -1,4 +1,3 @@ -import { Alert, Spinner } from '@heroui/react' import Scrollbar from '@renderer/components/Scrollbar' import { useAgents } from '@renderer/hooks/agents/useAgents' import { useApiServer } from '@renderer/hooks/useApiServer' @@ -11,6 +10,7 @@ import { useAppDispatch } from '@renderer/store' import { addIknowAction } from '@renderer/store/runtime' import type { Assistant, AssistantsSortType, Topic } from '@renderer/types' import { getErrorMessage } from '@renderer/utils' +import { Alert } from 'antd' import type { FC } from 'react' import { useCallback, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -128,26 +128,24 @@ const AssistantsTab: FC = (props) => { {!apiServerConfig.enabled && !apiServerRunning && !iknow[ALERT_KEY] && ( { - dispatch(addIknowAction(ALERT_KEY)) - }} - className="mb-2" + type="warning" + message={t('agent.warning.enable_server')} + closable + onClose={() => dispatch(addIknowAction(ALERT_KEY))} + style={{ marginBottom: 10 }} + showIcon /> )} - - {(agentsLoading || apiServerLoading) && } {apiServerConfig.enabled && !apiServerLoading && !apiServerRunning && ( - + )} {apiServerRunning && agentsError && ( )} diff --git a/src/renderer/src/pages/home/Tabs/components/Sessions.tsx b/src/renderer/src/pages/home/Tabs/components/Sessions.tsx index 5a36ce5d2..edf837fb7 100644 --- a/src/renderer/src/pages/home/Tabs/components/Sessions.tsx +++ b/src/renderer/src/pages/home/Tabs/components/Sessions.tsx @@ -1,4 +1,3 @@ -import { Alert, Spinner } from '@heroui/react' import { DynamicVirtualList } from '@renderer/components/VirtualList' import { useCreateDefaultSession } from '@renderer/hooks/agents/useCreateDefaultSession' import { useSessions } from '@renderer/hooks/agents/useSessions' @@ -11,6 +10,7 @@ import { setSessionWaitingAction } from '@renderer/store/runtime' import { buildAgentSessionTopicId } from '@renderer/utils/agentSession' +import { Alert, Spin } from 'antd' import { motion } from 'framer-motion' import { memo, useCallback, useEffect } from 'react' import { useTranslation } from 'react-i18next' @@ -87,12 +87,14 @@ const Sessions: React.FC = ({ agentId }) => { animate={{ opacity: 1 }} exit={{ opacity: 0 }} className="flex h-full items-center justify-center"> - + ) } - if (error) return + if (error) { + return + } return (
diff --git a/src/renderer/src/pages/home/Tabs/components/SessionsSection.tsx b/src/renderer/src/pages/home/Tabs/components/SessionsSection.tsx deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/renderer/src/pages/home/Tabs/index.tsx b/src/renderer/src/pages/home/Tabs/index.tsx index eb8880f65..7d6a77b50 100644 --- a/src/renderer/src/pages/home/Tabs/index.tsx +++ b/src/renderer/src/pages/home/Tabs/index.tsx @@ -1,4 +1,3 @@ -import { Skeleton } from '@heroui/react' import AddAssistantPopup from '@renderer/components/Popups/AddAssistantPopup' import { useActiveSession } from '@renderer/hooks/agents/useActiveSession' import { useUpdateSession } from '@renderer/hooks/agents/useUpdateSession' @@ -12,7 +11,7 @@ import { setActiveAgentId, setActiveTopicOrSessionAction } from '@renderer/store import type { Assistant, Topic } from '@renderer/types' import type { Tab } from '@renderer/types/chat' import { classNames, getErrorMessage, uuid } from '@renderer/utils' -import { Alert } from 'antd' +import { Alert, Skeleton } from 'antd' import type { FC } from 'react' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -167,11 +166,11 @@ const HomeTabs: FC = ({ )} {tab === 'settings' && isTopicView && } {tab === 'settings' && isSessionView && !sessionError && ( - + )} - {tab === 'settings' && ( + {tab === 'settings' && isSessionView && sessionError && (