mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-21 15:55:50 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,33 +1,30 @@
|
||||
import React from 'react'
|
||||
import { Box, Text, stringWidth } from '@anthropic/ink'
|
||||
import type { NormalizedMessage } from '../types/message.js'
|
||||
import React from 'react';
|
||||
import { Box, Text, stringWidth } from '@anthropic/ink';
|
||||
import type { NormalizedMessage } from '../types/message.js';
|
||||
|
||||
type Props = {
|
||||
message: NormalizedMessage
|
||||
isTranscriptMode: boolean
|
||||
}
|
||||
message: NormalizedMessage;
|
||||
isTranscriptMode: boolean;
|
||||
};
|
||||
|
||||
export function MessageModel({
|
||||
message,
|
||||
isTranscriptMode,
|
||||
}: Props): React.ReactNode {
|
||||
const content = message.message?.content
|
||||
const contentArray = Array.isArray(content) ? content : []
|
||||
export function MessageModel({ message, isTranscriptMode }: Props): React.ReactNode {
|
||||
const content = message.message?.content;
|
||||
const contentArray = Array.isArray(content) ? content : [];
|
||||
const shouldShowModel =
|
||||
isTranscriptMode &&
|
||||
message.type === 'assistant' &&
|
||||
message.message?.model &&
|
||||
contentArray.some((c: any) => c?.type === 'text')
|
||||
contentArray.some((c: any) => c?.type === 'text');
|
||||
|
||||
if (!shouldShowModel) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
const model = message.message!.model as string
|
||||
const model = message.message!.model as string;
|
||||
|
||||
return (
|
||||
<Box minWidth={stringWidth(model) + 8}>
|
||||
<Text dimColor>{model}</Text>
|
||||
</Box>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user