summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/Footer.tsx
blob: 06721a4b639e0f54a29639fc30693f002aec476f (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
/**
 * @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;
  queryLength: number;
  debugMode: boolean;
  debugMessage: string;
  cliVersion: string;
}

export const Footer: React.FC<FooterProps> = ({
  config,
  queryLength,
  debugMode,
  debugMessage,
  cliVersion,
}) => (
  <Box marginTop={1} display="flex" justifyContent="space-between" width="100%">
    {/* Left Section: Help/DebugMode */}
    <Box>
      <Text color={Colors.SubtleComment}>
        {queryLength === 0 ? '? for shortcuts' : ''}
        {debugMode && (
          <Text color={Colors.AccentRed}>
            {' '}
            {debugMessage || 'Running in debug mode.'}
          </Text>
        )}
      </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>
    </Box>
  </Box>
);