/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type React from 'react'; import { Box, Text } from 'ink'; import { theme } from '../semantic-colors.js'; import { checkExhaustive } from '@google/gemini-cli-core'; export type ChecklistStatus = | 'pending' | 'in_progress' | 'completed' | 'cancelled'; export interface ChecklistItemData { status: ChecklistStatus; label: string; } const ChecklistStatusDisplay: React.FC<{ status: ChecklistStatus }> = ({ status, }) => { switch (status) { case 'completed': return ( โœ“ ); case 'in_progress': return ( ยป ); case 'pending': return ( โ˜ ); case 'cancelled': return ( โœ— ); default: checkExhaustive(status); } }; export interface ChecklistItemProps { item: ChecklistItemData; wrap?: 'truncate'; role?: 'listitem'; } export const ChecklistItem: React.FC = ({ item, wrap, role: ariaRole, }) => { const textColor = (() => { switch (item.status) { case 'in_progress': return theme.text.accent; case 'completed': case 'cancelled': return theme.text.secondary; case 'pending': return theme.text.primary; default: checkExhaustive(item.status); } })(); const strikethrough = item.status === 'cancelled'; return ( {item.label} ); };