mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-20 07:15:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import * as React from 'react'
|
||||
import { pathToFileURL } from 'url'
|
||||
import { Box, Link, supportsHyperlinks, Text } from '@anthropic/ink'
|
||||
import { getStoredImagePath } from '../../utils/imageStore.js'
|
||||
import { MessageResponse } from '../MessageResponse.js'
|
||||
import * as React from 'react';
|
||||
import { pathToFileURL } from 'url';
|
||||
import { Box, Link, supportsHyperlinks, Text } from '@anthropic/ink';
|
||||
import { getStoredImagePath } from '../../utils/imageStore.js';
|
||||
import { MessageResponse } from '../MessageResponse.js';
|
||||
|
||||
type Props = {
|
||||
imageId?: number
|
||||
addMargin?: boolean
|
||||
}
|
||||
imageId?: number;
|
||||
addMargin?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders an image attachment in user messages.
|
||||
@@ -15,12 +15,9 @@ type Props = {
|
||||
* Uses MessageResponse styling to appear connected to the message above,
|
||||
* unless addMargin is true (image starts a new user turn without text).
|
||||
*/
|
||||
export function UserImageMessage({
|
||||
imageId,
|
||||
addMargin,
|
||||
}: Props): React.ReactNode {
|
||||
const label = imageId ? `[Image #${imageId}]` : '[Image]'
|
||||
const imagePath = imageId ? getStoredImagePath(imageId) : null
|
||||
export function UserImageMessage({ imageId, addMargin }: Props): React.ReactNode {
|
||||
const label = imageId ? `[Image #${imageId}]` : '[Image]';
|
||||
const imagePath = imageId ? getStoredImagePath(imageId) : null;
|
||||
|
||||
const content =
|
||||
imagePath && supportsHyperlinks() ? (
|
||||
@@ -29,13 +26,13 @@ export function UserImageMessage({
|
||||
</Link>
|
||||
) : (
|
||||
<Text>{label}</Text>
|
||||
)
|
||||
);
|
||||
|
||||
// When this image starts a new user turn (no text before it),
|
||||
// show with margin instead of the connected line style
|
||||
if (addMargin) {
|
||||
return <Box marginTop={1}>{content}</Box>
|
||||
return <Box marginTop={1}>{content}</Box>;
|
||||
}
|
||||
|
||||
return <MessageResponse>{content}</MessageResponse>
|
||||
return <MessageResponse>{content}</MessageResponse>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user