feat(web): memory chat ui upgrade
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2025-12-10 16:46:14
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-03-06 13:36:20
|
||||
* @Last Modified time: 2026-03-19 17:35:14
|
||||
*/
|
||||
import { type FC, useEffect, useMemo, useState } from 'react'
|
||||
import { Flex, Input, Form } from 'antd'
|
||||
@@ -77,7 +77,7 @@ const ChatInput: FC<ChatInputProps> = ({
|
||||
|
||||
return (
|
||||
<div className={`rb:absolute rb:bottom-3 rb:left-0 rb:right-0 rb:w-full ${className}`}>
|
||||
<Flex vertical justify="space-between" className={clsx("rb-border rb:shadow-[0px_2px_12px_0px_rgba(23,23,25,0.1)] rb:rounded-xl rb:min-h-30", {
|
||||
<Flex vertical justify="space-between" className={clsx("rb-border rb:shadow-[0px_2px_12px_0px_rgba(23,23,25,0.12)] rb:rounded-3xl rb:min-h-30", {
|
||||
' rb:border-[#171719]!': isFocus
|
||||
})}>
|
||||
{previewFileList.length > 0 && <div className="rb:overflow-x-auto rb:max-w-full"><Flex gap={14} className="rb:mx-3! rb:mt-3! rb:w-max!">
|
||||
@@ -142,7 +142,8 @@ const ChatInput: FC<ChatInputProps> = ({
|
||||
</Flex>
|
||||
)
|
||||
})}
|
||||
</Flex></div>}
|
||||
</Flex>
|
||||
</div>}
|
||||
{/* Message input form */}
|
||||
<Form form={form} layout="vertical">
|
||||
<Form.Item name="message" noStyle>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2025-12-10 16:46:09
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-06 21:05:09
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-03-19 14:57:56
|
||||
*/
|
||||
import { type FC } from 'react'
|
||||
import ChatInput from './ChatInput'
|
||||
@@ -25,10 +25,11 @@ const Chat: FC<ChatProps> = ({
|
||||
labelFormat,
|
||||
errorDesc,
|
||||
fileList,
|
||||
fileChange
|
||||
fileChange,
|
||||
className
|
||||
}) => {
|
||||
return (
|
||||
<div className="rb:h-full rb:relative rb:pt-2">
|
||||
<div className={`rb:h-full rb:relative rb:pt-2 ${className}`}>
|
||||
{/* Chat content display area */}
|
||||
<ChatContent
|
||||
classNames={contentClassName}
|
||||
|
||||
@@ -53,6 +53,7 @@ export interface ChatProps {
|
||||
fileList?: any[];
|
||||
/** Attachment update */
|
||||
fileChange?: (fileList: any[]) => void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
80
web/src/components/RbCard/ResultCard.tsx
Normal file
80
web/src/components/RbCard/ResultCard.tsx
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 17:30:51
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-03-19 15:44:02
|
||||
*/
|
||||
/**
|
||||
* ResultCard Component
|
||||
* Collapsible card wrapper for configuration sections
|
||||
*/
|
||||
|
||||
import { type FC, type ReactNode } from 'react'
|
||||
import clsx from 'clsx';
|
||||
import { Flex, Space, Tooltip } from 'antd';
|
||||
|
||||
import RbCard from '@/components/RbCard/Card'
|
||||
|
||||
/**
|
||||
* Component props
|
||||
*/
|
||||
interface ResultCardProps {
|
||||
title: string | ReactNode;
|
||||
subTitle?: string | ReactNode;
|
||||
children: ReactNode;
|
||||
expanded?: boolean;
|
||||
handleExpand?: () => void;
|
||||
className?: string;
|
||||
headerClassName?: string;
|
||||
bodyClassName?: string;
|
||||
extra?: ReactNode;
|
||||
isMiSans?: boolean;
|
||||
}
|
||||
|
||||
const ResultCard: FC<ResultCardProps> = ({
|
||||
title,
|
||||
subTitle,
|
||||
children,
|
||||
expanded,
|
||||
handleExpand,
|
||||
extra,
|
||||
className,
|
||||
headerClassName,
|
||||
bodyClassName,
|
||||
isMiSans = true,
|
||||
}) => {
|
||||
return (
|
||||
<RbCard
|
||||
title={() => <Flex
|
||||
align="center"
|
||||
justify="space-between"
|
||||
className={`${isMiSans ? 'rb:font-[MiSans-Bold] rb:font-bold' : 'rb:font-medium'} rb:cursor-pointer`}
|
||||
onClick={handleExpand}
|
||||
>
|
||||
<Space size={4}>
|
||||
{title}
|
||||
{subTitle && <Tooltip title={subTitle}>
|
||||
<div className="rb:size-4 rb:bg-cover rb:bg-[url('@/assets/images/common/question.svg')]"></div>
|
||||
</Tooltip>}
|
||||
</Space>
|
||||
<Space size={4}>
|
||||
{extra}
|
||||
{handleExpand && <div
|
||||
className={clsx("rb:size-4 rb:bg-cover rb:bg-[url('@/assets/images/common/arrow_up.svg')] rb:transition-transform", {
|
||||
'rb:rotate-180': !expanded,
|
||||
'rb:rotate-0': expanded,
|
||||
})}
|
||||
></div>}
|
||||
</Space>
|
||||
</Flex>}
|
||||
headerType="borderless"
|
||||
headerClassName={headerClassName ?? "rb:min-h-[40px]! rb:text-[#212332]! rb:text-[14px]!"}
|
||||
bodyClassName={bodyClassName ?? "rb:py-0! rb:px-3!"}
|
||||
className={className ?? "rb:bg-[#F6F6F6]!"}
|
||||
>
|
||||
{((expanded && handleExpand) || (!handleExpand))&& children}
|
||||
</RbCard>
|
||||
)
|
||||
}
|
||||
|
||||
export default ResultCard
|
||||
Reference in New Issue
Block a user