style(渲染): 优化Markdown渲染和数据格式

- 行内代码简化样式,仅使用等宽字体
- 列表项标记颜色调整为品牌色
- Mock数据更新适配新的模型格式
- 首页模型格式转换逻辑更新
This commit is contained in:
gaoziman 2025-12-20 01:05:25 +08:00
parent 2a4ede5726
commit e2679208aa
3 changed files with 9 additions and 8 deletions

View File

@ -35,7 +35,8 @@ export default function HomePage() {
// 转换模型格式 // 转换模型格式
const modelOptions = models.map((m) => ({ const modelOptions = models.map((m) => ({
id: m.modelId, id: m.modelId,
name: m.displayName, name: m.modelId,
displayName: m.displayName,
tag: m.supportsThinking ? 'Thinking' : '', tag: m.supportsThinking ? 'Thinking' : '',
})); }));

View File

@ -19,10 +19,10 @@ const markdownComponents = {
const isInline = !match && !className; const isInline = !match && !className;
if (isInline) { if (isInline) {
// 行内代码 // 行内代码 - 无特殊样式,仅等宽字体
return ( return (
<code <code
className="bg-red-50 text-red-700 px-1.5 py-0.5 rounded text-sm font-mono" className="font-mono"
{...props} {...props}
> >
{children} {children}
@ -81,14 +81,14 @@ const markdownComponents = {
// 列表 // 列表
ul({ children }: { children?: React.ReactNode }) { ul({ children }: { children?: React.ReactNode }) {
return ( return (
<ul className="list-disc pl-5 my-2 space-y-1"> <ul className="list-disc pl-5 my-2 space-y-1 marker:text-[#E06B3E]">
{children} {children}
</ul> </ul>
); );
}, },
ol({ children }: { children?: React.ReactNode }) { ol({ children }: { children?: React.ReactNode }) {
return ( return (
<ol className="list-decimal pl-5 my-2 space-y-1"> <ol className="list-decimal pl-5 my-2 space-y-1 marker:text-[#E06B3E]">
{children} {children}
</ol> </ol>
); );

View File

@ -2,9 +2,9 @@ import type { Model, Tool, ChatHistory, Message, User, QuickAction } from '@/typ
// 模型列表 // 模型列表
export const models: Model[] = [ export const models: Model[] = [
{ id: 'haiku', name: 'Haiku 4.5', tag: 'Fast' }, { id: 'haiku', name: 'claude-haiku-4-5-20251001', displayName: 'Haiku', tag: 'Fast' },
{ id: 'sonnet', name: 'Sonnet 4.5', tag: 'Balanced' }, { id: 'sonnet', name: 'claude-sonnet-4-5-20250929', displayName: 'Sonnet', tag: 'Balanced' },
{ id: 'opus', name: 'Opus 4.5', tag: 'Powerful' }, { id: 'opus', name: 'claude-opus-4-5-20251101', displayName: 'Opus', tag: 'Powerful' },
]; ];
// 工具列表 // 工具列表