fix(style): document list
This commit is contained in:
@@ -10,18 +10,20 @@ interface FileListProps {
|
|||||||
fileList: { text: string; name: string; uid: number | string }[];
|
fileList: { text: string; name: string; uid: number | string }[];
|
||||||
ghost?: boolean;
|
ghost?: boolean;
|
||||||
showIcon?: boolean;
|
showIcon?: boolean;
|
||||||
|
textListCount: number;
|
||||||
onDelete?: (uid: number | string) => void;
|
onDelete?: (uid: number | string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FileList: React.FC<FileListProps> = (props) => {
|
const FileList: React.FC<FileListProps> = (props) => {
|
||||||
const { fileList, ghost, showIcon = true, onDelete } = props;
|
const { textListCount, fileList, ghost, showIcon = true, onDelete } = props;
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
return (
|
return (
|
||||||
<div className="file-list">
|
<div className="file-list">
|
||||||
{fileList.map((file) => {
|
{fileList.map((file, index) => {
|
||||||
return (
|
return (
|
||||||
<div key={file.uid} className={classNames('file-item', { ghost })}>
|
<div key={file.uid} className={classNames('file-item', { ghost })}>
|
||||||
<span className="title">
|
<span className="title">
|
||||||
|
<span className="m-r-5">{index + 1 + textListCount}.</span>
|
||||||
{showIcon && <PaperClipOutlined className="m-r-5" />}
|
{showIcon && <PaperClipOutlined className="m-r-5" />}
|
||||||
<AutoTooltip ghost> {file.name}</AutoTooltip>
|
<AutoTooltip ghost> {file.name}</AutoTooltip>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -306,6 +306,7 @@ const GroundReranker: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
<div style={{ marginTop: 8 }}>
|
<div style={{ marginTop: 8 }}>
|
||||||
<FileList
|
<FileList
|
||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
|
textListCount={textList.length || 0}
|
||||||
onDelete={handleDeleteFile}
|
onDelete={handleDeleteFile}
|
||||||
></FileList>
|
></FileList>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const InputList: React.FC<InputListProps> = ({ textList, onChange }) => {
|
|||||||
<div key={text.uid} className="input-item">
|
<div key={text.uid} className="input-item">
|
||||||
<div className="input-wrap">
|
<div className="input-wrap">
|
||||||
<RowTextarea
|
<RowTextarea
|
||||||
label={`Text ${index + 1}`}
|
label={`${index + 1}.`}
|
||||||
value={text.text}
|
value={text.text}
|
||||||
onChange={(e) => handleTextChange(e.target.value, text)}
|
onChange={(e) => handleTextChange(e.target.value, text)}
|
||||||
></RowTextarea>
|
></RowTextarea>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const RerankMessage: React.FC<RerankMessageProps> = ({ dataList }) => {
|
|||||||
</span>
|
</span>
|
||||||
</dt>
|
</dt>
|
||||||
<dd className="text">{sItem.text}</dd>
|
<dd className="text">{sItem.text}</dd>
|
||||||
<dd className="doc-name">《{sItem.title}》</dd>
|
{/* <dd className="doc-name">《{sItem.title}》</dd> */}
|
||||||
</dl>
|
</dl>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
Reference in New Issue
Block a user