feat(web): use bg replace img
This commit is contained in:
@@ -16,8 +16,6 @@ import { Row, Col, Skeleton, Spin, Flex, Tooltip } from 'antd'
|
||||
import { LoadingOutlined } from '@ant-design/icons';
|
||||
import { useParams } from 'react-router-dom'
|
||||
|
||||
import aboutUs from '@/assets/images/userMemory/aboutUs.svg'
|
||||
import memoryInsight from '@/assets/images/userMemory/memoryInsight.svg'
|
||||
import RbCard from '@/components/RbCard/Card'
|
||||
import type { Data } from './types'
|
||||
import {
|
||||
@@ -34,12 +32,12 @@ import ConversationMemory from './components/ConversationMemory'
|
||||
*/
|
||||
interface TitleProps {
|
||||
title: string
|
||||
icon: string
|
||||
iconClassName: string
|
||||
}
|
||||
/** Collapsible section title */
|
||||
const Title: FC<TitleProps> = ({ title, icon }) => (
|
||||
const Title: FC<TitleProps> = ({ title, iconClassName }) => (
|
||||
<Flex align="center" gap={4} className="rb:font-medium rb:leading-5 rb:mb-2.25!">
|
||||
<img src={icon} className="rb:size-4.5 rb:ml-0.5" />
|
||||
<div className={`rb:size-4.5 rb:ml-0.5 rb:bg-cover ${iconClassName}`} />
|
||||
{title}
|
||||
</Flex>
|
||||
)
|
||||
@@ -143,7 +141,7 @@ const Rag: FC = () => {
|
||||
<>
|
||||
<Title
|
||||
title={t('userMemory.aboutMe')}
|
||||
icon={aboutUs}
|
||||
iconClassName="rb:bg-[url('@/assets/images/userMemory/aboutUs.svg')]"
|
||||
/>
|
||||
<div className="rb:bg-[#F6F6F6] rb:rounded-lg rb:py-2.5 rb:px-3 rb:mb-4">
|
||||
{loading.summary
|
||||
@@ -160,7 +158,7 @@ const Rag: FC = () => {
|
||||
<>
|
||||
<Title
|
||||
title={t('userMemory.memoryInsight')}
|
||||
icon={memoryInsight}
|
||||
iconClassName="rb:bg-[url('@/assets/images/userMemory/memoryInsight.svg')]"
|
||||
/>
|
||||
<div className="rb:bg-[#F6F6F6] rb:rounded-lg rb:py-2.5 rb:px-3">
|
||||
{loading.insight
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 18:32:30
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 18:32:30
|
||||
*/
|
||||
/**
|
||||
* Page Header Component
|
||||
* Header with navigation and operation buttons
|
||||
*/
|
||||
|
||||
import { type FC, type ReactNode } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Layout, Button } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import logoutIcon from '@/assets/images/logout_hover.svg'
|
||||
|
||||
const { Header } = Layout;
|
||||
|
||||
/**
|
||||
* Component props
|
||||
*/
|
||||
interface ConfigHeaderProps {
|
||||
name?: string;
|
||||
operation?: ReactNode;
|
||||
source?: 'detail' | 'node';
|
||||
extra?: ReactNode;
|
||||
}
|
||||
const PageHeader: FC<ConfigHeaderProps> = ({
|
||||
name,
|
||||
operation,
|
||||
source = 'detail',
|
||||
extra
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
/** Navigate back */
|
||||
const goBack = () => {
|
||||
if (source === 'detail') {
|
||||
navigate('/user-memory', { replace: true })
|
||||
} else {
|
||||
navigate(-1)
|
||||
}
|
||||
}
|
||||
return (
|
||||
<Header className="rb:w-full rb:h-16 rb:flex rb:justify-between rb:p-[16px_16px_16px_24px]! rb:border-b rb:border-[#EAECEE] rb:leading-8">
|
||||
<div className="rb:h-8 rb:flex rb:items-center rb:font-medium">
|
||||
{t('userMemory.memoryWindow', { name: name })}
|
||||
{operation}
|
||||
</div>
|
||||
|
||||
<div className="rb:flex rb:items-center rb:gap-3">
|
||||
<Button type="primary" ghost className="rb:h-6! rb:px-2! rb:leading-5.5!" onClick={goBack}>
|
||||
<img src={logoutIcon} className="rb:w-4 rb:h-4" />
|
||||
{t('common.return')}
|
||||
</Button>
|
||||
{extra}
|
||||
</div>
|
||||
</Header>
|
||||
);
|
||||
};
|
||||
|
||||
export default PageHeader;
|
||||
@@ -104,7 +104,7 @@ const GraphDetail = forwardRef<GraphDetailRef>((_props, ref) => {
|
||||
<Space size={12}>
|
||||
<Button
|
||||
className="rb:px-2! rb:gap-0.5!"
|
||||
icon={<div className="rb:size-4 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/common/return.svg')]"></div>}
|
||||
icon={<div className="rb:bg-[url('@/assets/images/workflow/return.svg')] rb:size-4 rb:bg-cover"></div>}
|
||||
onClick={() => navigate(-1)}
|
||||
>
|
||||
{t('common.return')}
|
||||
|
||||
@@ -106,7 +106,7 @@ const Detail: FC = () => {
|
||||
}
|
||||
<Button
|
||||
className="rb:px-2! rb:gap-0.5!"
|
||||
icon={<div className="rb:size-4 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/common/return.svg')]"></div>}
|
||||
icon={<div className="rb:bg-[url('@/assets/images/workflow/return.svg')] rb:size-4 rb:bg-cover"></div>}
|
||||
onClick={handleGoBack}
|
||||
>
|
||||
{t('common.return')}
|
||||
|
||||
Reference in New Issue
Block a user