Browse Source

fix: compile erros

Yifei Zhang 2 years ago
parent
commit
701a6e413f
2 changed files with 3 additions and 3 deletions
  1. 2 2
      app/components/home.tsx
  2. 1 1
      app/components/ui-lib.tsx

+ 2 - 2
app/components/home.tsx

@@ -311,8 +311,8 @@ function exportMessages(messages: Message[], topic: string) {
     title: "导出聊天记录为 Markdown", children: <div className="markdown-body">
       <pre className={styles['export-content']}>{mdText}</pre>
     </div>, actions: [
-      <IconButton icon={<CopyIcon />} bordered text="全部复制" onClick={() => copyToClipboard(mdText)} />,
-      <IconButton icon={<DownloadIcon />} bordered text="下载文件" onClick={() => downloadAs(mdText, filename)} />
+      <IconButton key="copy" icon={<CopyIcon />} bordered text="全部复制" onClick={() => copyToClipboard(mdText)} />,
+      <IconButton key="download" icon={<DownloadIcon />} bordered text="下载文件" onClick={() => downloadAs(mdText, filename)} />
     ]
   })
 }

+ 1 - 1
app/components/ui-lib.tsx

@@ -71,7 +71,7 @@ export function Modal(props: ModalProps) {
 
     <div className={styles['modal-footer']}>
       <div className={styles['modal-actions']}>
-        {props.actions?.map(action => <div className={styles['modal-action']}>{action}</div>)}
+        {props.actions?.map((action, i) => <div key={i} className={styles['modal-action']}>{action}</div>)}
       </div>
     </div>
   </div>