summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/Footer.tsx
blob: 3b3cac724500bd6c4df27eb274c9a173ad310ce8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

import React from 'react';
import { Box, Text } from 'ink';
import { Colors } from '../colors.js';
import { Config } from '@gemini-code/server';

interface FooterProps {
  config: Config;
  debugMode: boolean;
  debugMessage: string;
  cliVersion: string;
  geminiMdFileCount: number;
  corgiMode: boolean;
}

export const Footer: React.FC<FooterProps> = ({
  config,
  debugMode,
  debugMessage,
  cliVersion,
  geminiMdFileCount,
  corgiMode,
}) => (
  <Box marginTop={1}>
    <Box>
      {geminiMdFileCount > 0 && (
        <Text color={Colors.SubtleComment}>
          Using {geminiMdFileCount} GEMINI.md files
        </Text>
      )}
      {debugMode && (
        <Text color={Colors.AccentRed}>
          {debugMessage || ' | Running in debug mode.'}
        </Text>
      )}
    </Box>

    {/* Middle Section: Centered Sandbox Info */}
    <Box
      flexGrow={1}
      alignItems="center"
      justifyContent="center"
      display="flex"
    >
      {process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec' ? (
        <Text color="green">
          {process.env.SANDBOX.replace(/^gemini-(?:code-)?/, '')}
        </Text>
      ) : process.env.SANDBOX === 'sandbox-exec' ? (
        <Text color={Colors.AccentYellow}>
          sandbox-exec ({process.env.SEATBELT_PROFILE})
        </Text>
      ) : (
        <Text color={Colors.AccentRed}>no sandbox (see README)</Text>
      )}
    </Box>

    {/* Right Section: Gemini Label */}
    <Box>
      <Text color={Colors.AccentBlue}> {config.getModel()} </Text>
      <Text color={Colors.SubtleComment}>| CLI {cliVersion} </Text>
      {corgiMode && (
        <Text>
          <Text color={Colors.SubtleComment}>| </Text>
          <Text color={Colors.AccentRed}>▼</Text>
          <Text color={Colors.Foreground}>(´</Text>
          <Text color={Colors.AccentRed}>ᴥ</Text>
          <Text color={Colors.Foreground}>`)</Text>
          <Text color={Colors.AccentRed}>▼ </Text>
        </Text>
      )}
    </Box>
  </Box>
);