style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -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>
)
);
}