fix(style): markdown viewer text-intent

This commit is contained in:
jialin
2024-09-29 16:54:00 +08:00
parent 5c2503b2a8
commit 69ffdd4604
10 changed files with 63 additions and 54 deletions
+11 -8
View File
@@ -519,17 +519,20 @@ const Models: React.FC<ModelsProps> = ({
span={5}
render={(text, record: ListItem) => {
return (
<span className="flex-center" style={{ maxWidth: '100%' }}>
<AutoTooltip className="m-r-5" ghost>
{text}
<span
className="flex-center flex-wrap"
style={{ maxWidth: '100%' }}
>
<AutoTooltip ghost>
<span className="m-r-5">{text}</span>
</AutoTooltip>
<span>
{record.embedding_only && (
<Tag style={{ marginTop: 6 }} color="geekblue">
{record.embedding_only && (
<span>
<Tag style={{ margin: 0 }} color="geekblue">
Embedding Only
</Tag>
)}
</span>
</span>
)}
</span>
);
}}
@@ -1,12 +1,7 @@
import IconFont from '@/components/icon-font';
import HotKeys, { KeyMap } from '@/config/hotkeys';
import { platformCall } from '@/utils';
import {
ClearOutlined,
ControlOutlined,
SendOutlined,
SwapOutlined
} from '@ant-design/icons';
import { ClearOutlined, SendOutlined, SwapOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Divider, Input, Select, Tooltip } from 'antd';
import _ from 'lodash';
@@ -351,7 +346,7 @@ const MessageInput: React.FC<MessageInputProps> = ({
></Button>
</Tooltip>
<Tooltip
{/* <Tooltip
title={intl.formatMessage({ id: 'playground.toolbar.prompts' })}
>
<Button
@@ -360,7 +355,7 @@ const MessageInput: React.FC<MessageInputProps> = ({
size="middle"
onClick={handleOpenPrompt}
></Button>
</Tooltip>
</Tooltip> */}
{updateLayout && (
<>
<Divider type="vertical" style={{ margin: 0 }} />
@@ -1,7 +1,7 @@
import useOverlayScroller from '@/hooks/use-overlay-scroller';
import { useIntl } from '@umijs/max';
import { Button, Modal, Typography } from 'antd';
import React from 'react';
import SimpleBar from 'simplebar-react';
import 'simplebar-react/dist/simplebar.min.css';
import promptList from '../config/prompt';
import '../style/prompt-modal.less';
@@ -15,6 +15,15 @@ type ViewModalProps = {
const AddWorker: React.FC<ViewModalProps> = (props) => {
const { open, onCancel } = props || {};
const intl = useIntl();
const { initialize } = useOverlayScroller();
const scrollerRef = React.useRef<any>(null);
React.useEffect(() => {
if (scrollerRef.current) {
initialize(scrollerRef.current);
}
}, [scrollerRef.current, initialize]);
const handleSelect = (item: {
title: string;
data: { role: string; content: string }[];
@@ -45,7 +54,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
}}
footer={null}
>
<SimpleBar style={{ maxHeight: '550px' }}>
<div ref={scrollerRef} style={{ maxHeight: '550px', overflow: 'auto' }}>
<div className="prompt-wrapper">
{promptList.map((item, index) => {
return (
@@ -83,7 +92,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
);
})}
</div>
</SimpleBar>
</div>
</Modal>
);
};