feat: update UI components and settings structure, remove unused icons
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useRef } from 'react';
|
||||
import { SendHorizontal, Square, X, Paperclip, FileText, Film, Music, FileArchive, File, Loader2, AtSign } from 'lucide-react';
|
||||
import type { AttachedFileMeta } from '../../shared/chat-model';
|
||||
|
||||
type ChatComposerProps = {
|
||||
@@ -32,9 +33,6 @@ export default function ChatComposer({
|
||||
<div className="border-t border-[#edf2f7] px-6 py-4 dark:border-[#2a2a2d]">
|
||||
<div className="rounded-[18px] border border-[#dfeaf6] bg-white p-4 shadow-[0_10px_30px_rgba(15,23,42,0.04)] dark:border-[#2a2a2d] dark:bg-[#1f1f22]">
|
||||
<div className="flex items-start gap-3">
|
||||
<div className="mt-1 flex h-9 w-9 flex-none items-center justify-center rounded-full bg-[#eff6ff] text-xs font-bold text-[#2B7FFF] dark:bg-[#222225]">
|
||||
AI
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
{error ? (
|
||||
<div className="mb-3 flex items-center justify-between gap-3 rounded-[14px] border border-[#fecaca] bg-[#fff1f2] px-4 py-3 text-sm text-[#b91c1c] dark:border-[#7f1d1d] dark:bg-[#2d1618] dark:text-[#fca5a5]">
|
||||
@@ -100,21 +98,14 @@ export default function ChatComposer({
|
||||
className="rounded-full border border-[#E5E8EE] px-3 py-1.5 text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300"
|
||||
onClick={() => fileInputRef.current?.click()}
|
||||
>
|
||||
添加附件
|
||||
<Paperclip className="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded-full border border-[#E5E8EE] px-3 py-1.5 text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300"
|
||||
onClick={isSending ? onStop : onSend}
|
||||
>
|
||||
{isSending ? '停止生成' : '发送消息'}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="rounded-full border border-[#E5E8EE] px-3 py-1.5 text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300"
|
||||
onClick={() => onChange('')}
|
||||
>
|
||||
清空输入
|
||||
{isSending ? <Square className="h-4 w-4" /> : <SendHorizontal className="h-4 w-4" />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,7 +120,7 @@ function ChatHistoryPanel({
|
||||
|
||||
{!isCompact ? (
|
||||
<div className={cx('flex min-w-0 items-center gap-3', isCompact && 'flex-col gap-2')}>
|
||||
<div className="flex h-12 w-12 flex-none items-center justify-center overflow-hidden rounded-[16px] border border-white bg-white shadow-[0_6px_16px_rgba(15,23,42,0.08)]">
|
||||
<div className="flex h-12 w-12 flex-none items-center justify-center overflow-hidden rounded-2xl border border-white bg-white shadow-[0_6px_16px_rgba(15,23,42,0.08)]">
|
||||
<img className="h-full w-full object-cover" src={blueLogo} alt="YINIAN" />
|
||||
</div>
|
||||
<div className="truncate text-[20px] font-semibold whitespace-nowrap tracking-[0.06em] text-[#111827] dark:text-gray-50">
|
||||
@@ -132,7 +132,7 @@ function ChatHistoryPanel({
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="inline-flex h-12 w-12 items-center justify-center text-[#64748b] transition-colors border border-white hover:text-[#111827] rounded-[14px] dark:border-[#2a2a2d] dark:text-gray-300 dark:hover:border-[#3a3a3f] dark:hover:text-gray-100"
|
||||
className={cx('inline-flex h-12 w-12 items-center justify-center text-[#64748b] transition-colors border hover:text-[#111827] rounded-lg dark:border-[#2a2a2d] dark:text-gray-300 dark:hover:border-[#3a3a3f] dark:hover:text-gray-100', isCompact ? 'border-[#e3eaf3]' : 'border-transparent')}
|
||||
title={isCompact ? '展开侧栏' : '收起侧栏'}
|
||||
onClick={() => {
|
||||
setMenuState(null);
|
||||
@@ -153,7 +153,7 @@ function ChatHistoryPanel({
|
||||
onClick={onNewChat}
|
||||
>
|
||||
<Plus className="h-5 w-5 flex-none" />
|
||||
{!isCompact ? <span>新对话</span> : null}
|
||||
{!isCompact ? <span className='whitespace-nowrap'>新对话</span> : null}
|
||||
</button>
|
||||
|
||||
<div className="min-h-0 flex-1 overflow-y-auto pt-4">
|
||||
|
||||
@@ -13,7 +13,7 @@ const MENU_MARKS: Record<string, typeof House> = {
|
||||
'/models': Cpu,
|
||||
'/skills': Puzzle,
|
||||
'/cron': Clock,
|
||||
'/scripts': Code,
|
||||
// '/scripts': Code,
|
||||
'/setting': Settings,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user