feat(components): Add markdown editing capability and enhance component styling
- Add editable mode to Markdown component with edit/save/cancel buttons - Import EditOutlined, SaveOutlined, CloseOutlined icons from ant-design - Add useState, useRef, useEffect hooks for managing edit state - Add editable, onContentChange, and onSave props to RbMarkdownProps interface - Create RbModal component with new index.css stylesheet for modal styling - Add index.css stylesheet to KnowledgeBase components for consistent styling - Update i18n translations in en.ts and zh.ts for new UI elements - Refactor Markdown component handlers to accept and spread additional props - Update InsertModal and RecallTestResult components for improved UX - Fix prop spreading in component handlers to maintain compatibility with Ant Design components
This commit is contained in:
3
web/src/components/RbModal/index.css
Normal file
3
web/src/components/RbModal/index.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.rb-modal .ant-modal-header {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
@@ -1,11 +1,19 @@
|
||||
/*
|
||||
* @Description:
|
||||
* @Version: 0.0.1
|
||||
* @Author: yujiangping
|
||||
* @Date: 2025-12-16 10:19:18
|
||||
* @LastEditors: yujiangping
|
||||
* @LastEditTime: 2025-12-22 12:31:31
|
||||
*/
|
||||
import { type FC } from 'react'
|
||||
import { Modal, type ModalProps } from 'antd'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
const RbModal: FC<ModalProps> = ({
|
||||
onOk,
|
||||
onCancel,
|
||||
children,
|
||||
className,
|
||||
...props
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
@@ -16,6 +24,7 @@ const RbModal: FC<ModalProps> = ({
|
||||
cancelText={t('common.cancel')}
|
||||
onOk={onOk}
|
||||
destroyOnHidden={true}
|
||||
className={`rb-modal ${className || ''}`}
|
||||
{...props}
|
||||
>
|
||||
<div className='rb:max-h-[550px] rb:overflow-y-auto rb:overflow-x-hidden'>
|
||||
|
||||
Reference in New Issue
Block a user