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,20 +1,20 @@
import type { ConnectionState } from "../../src/acp/types";
import { cn } from "../../src/lib/utils";
import type { ConnectionState } from '../../src/acp/types';
import { cn } from '../../src/lib/utils';
// Shared styles for connection state dots
const connectionDotStyles: Record<ConnectionState, string> = {
disconnected: "bg-gray-400",
connecting: "bg-yellow-400 animate-pulse",
connected: "bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.6)]",
error: "bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]",
disconnected: 'bg-gray-400',
connecting: 'bg-yellow-400 animate-pulse',
connected: 'bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.6)]',
error: 'bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]',
};
// Shared labels for connection states
const connectionStateLabels: Record<ConnectionState, string> = {
disconnected: "Disconnected",
connecting: "Connecting...",
connected: "Connected",
error: "Error",
disconnected: 'Disconnected',
connecting: 'Connecting...',
connected: 'Connected',
error: 'Error',
};
/**
@@ -28,33 +28,17 @@ export function getConnectionStateLabel(state: ConnectionState): string {
* A small dot indicator for connection state
* Used in status bars and headers
*/
export function StatusDot({
state,
className,
}: {
state: ConnectionState;
className?: string;
}) {
return (
<span
className={cn("w-2 h-2 rounded-full", connectionDotStyles[state], className)}
/>
);
export function StatusDot({ state, className }: { state: ConnectionState; className?: string }) {
return <span className={cn('w-2 h-2 rounded-full', connectionDotStyles[state], className)} />;
}
/**
* A status indicator with dot and label
* Used in cards and detailed views
*/
export function StatusIndicator({
state,
className,
}: {
state: ConnectionState;
className?: string;
}) {
export function StatusIndicator({ state, className }: { state: ConnectionState; className?: string }) {
return (
<span className={cn("flex items-center gap-2 text-sm font-normal", className)}>
<span className={cn('flex items-center gap-2 text-sm font-normal', className)}>
<StatusDot state={state} />
{state}
</span>
@@ -74,17 +58,12 @@ export function ConnectionStatusBar({
className?: string;
}) {
return (
<div className={cn("flex items-center gap-2", className)}>
<div className={cn('flex items-center gap-2', className)}>
<StatusDot state={state} />
<span className="text-sm font-medium">
{getConnectionStateLabel(state)}
</span>
{state === "connected" && displayUrl && (
<span className="text-xs text-muted-foreground truncate max-w-[150px]">
{displayUrl}
</span>
<span className="text-sm font-medium">{getConnectionStateLabel(state)}</span>
{state === 'connected' && displayUrl && (
<span className="text-xs text-muted-foreground truncate max-w-[150px]">{displayUrl}</span>
)}
</div>
);
}