diff --git a/packages/cli/src/ui/components/shared/Card.tsx b/packages/cli/src/ui/components/shared/Card.tsx index 7d22a20808..61d0185f07 100644 --- a/packages/cli/src/ui/components/shared/Card.tsx +++ b/packages/cli/src/ui/components/shared/Card.tsx @@ -9,6 +9,7 @@ import { Box, Text } from 'ink'; import { theme } from '../../semantic-colors.js'; import { ToolStatusIndicator } from '../messages/ToolShared.js'; import { ToolCallStatus } from '../../types.js'; +import { checkExhaustive } from '@google/gemini-cli-core'; /** * Props for the Card component. @@ -24,6 +25,8 @@ export interface CardProps { children?: React.ReactNode; /** The styling and intent of the card. */ status?: ToolCallStatus; + /** The width of the card. Defaults to 100%. */ + width?: string | number; } export const Card: React.FC = ({ @@ -32,6 +35,7 @@ export const Card: React.FC = ({ prefix = true, suffix, children, + width = '100%', }) => { const getColors = () => { switch (status) { @@ -48,6 +52,7 @@ export const Card: React.FC = ({ case ToolCallStatus.Executing: return { border: theme.border.default, text: theme.status.success }; default: + checkExhaustive(status); return { border: theme.border.default, text: theme.text.primary }; } }; @@ -55,7 +60,7 @@ export const Card: React.FC = ({ const colors = getColors(); return ( - + {/* Top border section */} = ({ gap={1} justifyContent="flex-start" > - {/* TODO: Use shared ToolStatusIndicator component */} {prefix && } @@ -105,7 +109,6 @@ export const Card: React.FC = ({ borderColor={colors.border} > - {/* Content area */}