Matthias Nott
2026-03-07 3c02569a045aa5303f97142893f7cfef86eaf9b3
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import React, { useState } from "react";
import { Pressable, Text, View } from "react-native";
import * as Haptics from "expo-haptics";
import { useTheme } from "../../contexts/ThemeContext";
interface CommandBarProps {
  onScreenshot: () => void;
  onNavigate: () => void;
  onPhoto: () => void;
  onClear: () => void;
}
export function CommandBar({ onScreenshot, onNavigate, onPhoto, onClear }: CommandBarProps) {
  const { colors } = useTheme();
  return (
    <View
      style={{
        flexDirection: "row",
        paddingHorizontal: 12,
        paddingVertical: 6,
        gap: 8,
      }}
    >
      <CmdBtn icon="📸" label="Screen" onPress={onScreenshot} colors={colors} />
      <CmdBtn icon="🧭" label="Navigate" onPress={onNavigate} colors={colors} />
      <CmdBtn icon="📎" label="Photo" onPress={onPhoto} colors={colors} />
      <CmdBtn icon="🗑" label="Clear" onPress={onClear} colors={colors} />
    </View>
  );
}
interface TextModeCommandBarProps {
  onScreenshot: () => void;
  onNavigate: () => void;
  onPhoto: () => void;
  onHelp: () => void;
  onClear: () => void;
}
export function TextModeCommandBar({
  onScreenshot,
  onNavigate,
  onPhoto,
  onHelp,
  onClear,
}: TextModeCommandBarProps) {
  const { colors } = useTheme();
  return (
    <View
      style={{
        flexDirection: "row",
        paddingHorizontal: 12,
        paddingVertical: 6,
        gap: 8,
      }}
    >
      <CmdBtn icon="📸" label="Screen" onPress={onScreenshot} colors={colors} />
      <CmdBtn icon="🧭" label="Navigate" onPress={onNavigate} colors={colors} />
      <CmdBtn icon="📎" label="Photo" onPress={onPhoto} colors={colors} />
      <CmdBtn icon="❓" label="Help" onPress={onHelp} colors={colors} />
      <CmdBtn icon="🗑" label="Clear" onPress={onClear} colors={colors} />
    </View>
  );
}
function CmdBtn({
  icon,
  label,
  onPress,
  colors,
}: {
  icon: string;
  label: string;
  onPress: () => void;
  colors: ReturnType<typeof useTheme>["colors"];
}) {
  const [pressed, setPressed] = useState(false);
  return (
    <View style={{ flex: 1 }}>
      <Pressable
        onPressIn={() => setPressed(true)}
        onPressOut={() => setPressed(false)}
        onPress={() => {
          Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
          onPress();
        }}
      >
        <View
          style={{
            height: 68,
            borderRadius: 16,
            alignItems: "center",
            justifyContent: "center",
            backgroundColor: pressed ? colors.accent : colors.bgTertiary,
            borderWidth: 1.5,
            borderColor: pressed ? colors.accent : colors.border,
          }}
        >
          <Text style={{ fontSize: 26, marginBottom: 2 }}>{icon}</Text>
          <Text style={{ color: colors.textSecondary, fontSize: 13, fontWeight: "700" }}>
            {label}
          </Text>
        </View>
      </Pressable>
    </View>
  );
}