mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 16:25:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import type { CollapsedReadSearchGroup } from '../../types/message.js'
|
||||
import React from 'react';
|
||||
import { Text } from '@anthropic/ink';
|
||||
import type { CollapsedReadSearchGroup } from '../../types/message.js';
|
||||
|
||||
/**
|
||||
* Plain function (not a React component) so the React Compiler won't
|
||||
@@ -12,7 +12,7 @@ export function checkHasTeamMemOps(message: CollapsedReadSearchGroup): boolean {
|
||||
(message.teamMemorySearchCount ?? 0) > 0 ||
|
||||
(message.teamMemoryReadCount ?? 0) > 0 ||
|
||||
(message.teamMemoryWriteCount ?? 0) > 0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,74 +25,54 @@ export function TeamMemCountParts({
|
||||
isActiveGroup,
|
||||
hasPrecedingParts,
|
||||
}: {
|
||||
message: CollapsedReadSearchGroup
|
||||
isActiveGroup: boolean | undefined
|
||||
hasPrecedingParts: boolean
|
||||
message: CollapsedReadSearchGroup;
|
||||
isActiveGroup: boolean | undefined;
|
||||
hasPrecedingParts: boolean;
|
||||
}): React.ReactNode {
|
||||
const tmReadCount = message.teamMemoryReadCount ?? 0
|
||||
const tmSearchCount = message.teamMemorySearchCount ?? 0
|
||||
const tmWriteCount = message.teamMemoryWriteCount ?? 0
|
||||
const tmReadCount = message.teamMemoryReadCount ?? 0;
|
||||
const tmSearchCount = message.teamMemorySearchCount ?? 0;
|
||||
const tmWriteCount = message.teamMemoryWriteCount ?? 0;
|
||||
|
||||
if (tmReadCount === 0 && tmSearchCount === 0 && tmWriteCount === 0) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
const nodes: React.ReactNode[] = []
|
||||
let count = hasPrecedingParts ? 1 : 0
|
||||
const nodes: React.ReactNode[] = [];
|
||||
let count = hasPrecedingParts ? 1 : 0;
|
||||
|
||||
if (tmReadCount > 0) {
|
||||
const verb = isActiveGroup
|
||||
? count === 0
|
||||
? 'Recalling'
|
||||
: 'recalling'
|
||||
: count === 0
|
||||
? 'Recalled'
|
||||
: 'recalled'
|
||||
const verb = isActiveGroup ? (count === 0 ? 'Recalling' : 'recalling') : count === 0 ? 'Recalled' : 'recalled';
|
||||
if (count > 0) {
|
||||
nodes.push(<Text key="comma-tmr">, </Text>)
|
||||
nodes.push(<Text key="comma-tmr">, </Text>);
|
||||
}
|
||||
nodes.push(
|
||||
<Text key="team-mem-read">
|
||||
{verb} <Text bold>{tmReadCount}</Text> team{' '}
|
||||
{tmReadCount === 1 ? 'memory' : 'memories'}
|
||||
{verb} <Text bold>{tmReadCount}</Text> team {tmReadCount === 1 ? 'memory' : 'memories'}
|
||||
</Text>,
|
||||
)
|
||||
count++
|
||||
);
|
||||
count++;
|
||||
}
|
||||
|
||||
if (tmSearchCount > 0) {
|
||||
const verb = isActiveGroup
|
||||
? count === 0
|
||||
? 'Searching'
|
||||
: 'searching'
|
||||
: count === 0
|
||||
? 'Searched'
|
||||
: 'searched'
|
||||
const verb = isActiveGroup ? (count === 0 ? 'Searching' : 'searching') : count === 0 ? 'Searched' : 'searched';
|
||||
if (count > 0) {
|
||||
nodes.push(<Text key="comma-tms">, </Text>)
|
||||
nodes.push(<Text key="comma-tms">, </Text>);
|
||||
}
|
||||
nodes.push(<Text key="team-mem-search">{`${verb} team memories`}</Text>)
|
||||
count++
|
||||
nodes.push(<Text key="team-mem-search">{`${verb} team memories`}</Text>);
|
||||
count++;
|
||||
}
|
||||
|
||||
if (tmWriteCount > 0) {
|
||||
const verb = isActiveGroup
|
||||
? count === 0
|
||||
? 'Writing'
|
||||
: 'writing'
|
||||
: count === 0
|
||||
? 'Wrote'
|
||||
: 'wrote'
|
||||
const verb = isActiveGroup ? (count === 0 ? 'Writing' : 'writing') : count === 0 ? 'Wrote' : 'wrote';
|
||||
if (count > 0) {
|
||||
nodes.push(<Text key="comma-tmw">, </Text>)
|
||||
nodes.push(<Text key="comma-tmw">, </Text>);
|
||||
}
|
||||
nodes.push(
|
||||
<Text key="team-mem-write">
|
||||
{verb} <Text bold>{tmWriteCount}</Text> team{' '}
|
||||
{tmWriteCount === 1 ? 'memory' : 'memories'}
|
||||
{verb} <Text bold>{tmWriteCount}</Text> team {tmWriteCount === 1 ? 'memory' : 'memories'}
|
||||
</Text>,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return <>{nodes}</>
|
||||
return <>{nodes}</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user