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,14 +1,14 @@
|
||||
import * as React from 'react'
|
||||
import { pathToFileURL } from 'url'
|
||||
import { Link, supportsHyperlinks, Text } from '@anthropic/ink'
|
||||
import { getStoredImagePath } from '../utils/imageStore.js'
|
||||
import type { Theme } from '../utils/theme.js'
|
||||
import * as React from 'react';
|
||||
import { pathToFileURL } from 'url';
|
||||
import { Link, supportsHyperlinks, Text } from '@anthropic/ink';
|
||||
import { getStoredImagePath } from '../utils/imageStore.js';
|
||||
import type { Theme } from '../utils/theme.js';
|
||||
|
||||
type Props = {
|
||||
imageId: number
|
||||
backgroundColor?: keyof Theme
|
||||
isSelected?: boolean
|
||||
}
|
||||
imageId: number;
|
||||
backgroundColor?: keyof Theme;
|
||||
isSelected?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders an image reference like [Image #1] as a clickable link.
|
||||
@@ -18,17 +18,13 @@ type Props = {
|
||||
* - Terminal doesn't support hyperlinks
|
||||
* - Image file is not found in the store
|
||||
*/
|
||||
export function ClickableImageRef({
|
||||
imageId,
|
||||
backgroundColor,
|
||||
isSelected = false,
|
||||
}: Props): React.ReactNode {
|
||||
const imagePath = getStoredImagePath(imageId)
|
||||
const displayText = `[Image #${imageId}]`
|
||||
export function ClickableImageRef({ imageId, backgroundColor, isSelected = false }: Props): React.ReactNode {
|
||||
const imagePath = getStoredImagePath(imageId);
|
||||
const displayText = `[Image #${imageId}]`;
|
||||
|
||||
// If we have a stored image and terminal supports hyperlinks, make it clickable
|
||||
if (imagePath && supportsHyperlinks()) {
|
||||
const fileUrl = pathToFileURL(imagePath).href
|
||||
const fileUrl = pathToFileURL(imagePath).href;
|
||||
|
||||
return (
|
||||
<Link
|
||||
@@ -39,15 +35,11 @@ export function ClickableImageRef({
|
||||
</Text>
|
||||
}
|
||||
>
|
||||
<Text
|
||||
backgroundColor={backgroundColor}
|
||||
inverse={isSelected}
|
||||
bold={isSelected}
|
||||
>
|
||||
<Text backgroundColor={backgroundColor} inverse={isSelected} bold={isSelected}>
|
||||
{displayText}
|
||||
</Text>
|
||||
</Link>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Fallback: styled but not clickable
|
||||
@@ -55,5 +47,5 @@ export function ClickableImageRef({
|
||||
<Text backgroundColor={backgroundColor} inverse={isSelected}>
|
||||
{displayText}
|
||||
</Text>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user