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 (
);
}
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 (
);
}
function CmdBtn({
icon,
label,
onPress,
colors,
}: {
icon: string;
label: string;
onPress: () => void;
colors: ReturnType["colors"];
}) {
const [pressed, setPressed] = useState(false);
return (
setPressed(true)}
onPressOut={() => setPressed(false)}
onPress={() => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
onPress();
}}
>
{icon}
{label}
);
}