Files
deepseek-harness/packages/client/ui-conversation/src/client/chat/CompactionCommandCard.tsx
T

27 lines
1.0 KiB
TypeScript

// Only a structured checkpoint uses the compaction marker; all other outcomes
// retain the command's complete settlement text.
import type { ChatViewSlotProps, CommandRowOwnerProps } from '../contract/slots.ts'
import { CompactionItem } from './CompactionItem.tsx'
import { GenericCommandCard } from './GenericCommandCard.tsx'
interface CompactionCommandCardProps extends CommandRowOwnerProps {
t: ChatViewSlotProps['t']
}
/** Render one manual compaction lifecycle without duplicating its checkpoint marker. */
export function CompactionCommandCard({ node, compaction, t }: CompactionCommandCardProps) {
if (compaction !== undefined) {
return (
<CompactionItem
node={compaction}
title={t('message.compaction.commandTitle')}
fallbackSummary={node.outcome?.text ?? null}
t={t}
/>
)
}
if (node.outcome !== null) return <GenericCommandCard node={node} t={t} />
return <GenericCommandCard node={node} t={t} runningSummary={t('message.compaction.running')} />
}