Roo-Code/apps/cli/src/ui/components/tools/ModeTool.tsx
Chris Estreich ea9717d7ba
Add a TUI (#10480)
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
2026-01-09 19:19:58 -08:00

28 lines
807 B
TypeScript

import { Box, Text } from "ink"
import * as theme from "../../theme.js"
import { Icon } from "../Icon.js"
import type { ToolRendererProps } from "./types.js"
import { getToolIconName } from "./utils.js"
export function ModeTool({ toolData }: ToolRendererProps) {
const iconName = getToolIconName(toolData.tool)
const mode = toolData.mode || ""
const isSwitch = toolData.tool.includes("switch") || toolData.tool.includes("Switch")
return (
<Box flexDirection="row" gap={1} paddingX={1} marginBottom={1}>
<Icon name={iconName} color={theme.toolHeader} />
{isSwitch && mode && (
<Box gap={1}>
<Text color={theme.dimText}>Switching to</Text>
<Text color={theme.userHeader} bold>
{mode}
</Text>
<Text color={theme.dimText}>mode</Text>
</Box>
)}
</Box>
)
}