Something went wrong. Try again.
Your thinking partner.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980import { StyleSheet, View } from "react-native";import { useTheme } from "../../theme/ThemeProvider";import { space } from "../../theme/tokens";import { Icon } from "../ui/Icon";import { StatusDot } from "../ui/StatusDot";import { Text } from "../ui/Text";import { Touchable } from "../ui/Touchable";
export function ChatHeader({ status, onHistory, onSettings, onStop, stopping = false,}: { status?: { label: string; tone: "run" | "wait" | "danger" }; onHistory: () => void; onSettings: () => void; onStop?: () => void; stopping?: boolean;}) { const { colors } = useTheme(); return ( <View style={[styles.header, { borderColor: colors.surfaceEdge }]}> <Touchable accessibilityRole="button" accessibilityLabel="Conversation history" onPress={onHistory} style={styles.action} > <Icon name="history" size={21} strokeWidth={1.4} /> </Touchable> <View style={styles.identity}> <Text style={styles.wordmark}>CO</Text> {status && status.label !== "Connected" ? ( <View style={styles.status} accessibilityLiveRegion="polite"> <StatusDot tone={status.tone} /> <Text role="sub" ink={2}> {status.label} </Text> </View> ) : null} </View> <Touchable accessibilityRole="button" accessibilityLabel={onStop ? "Stop" : "Settings"} disabled={stopping} onPress={onStop ?? onSettings} style={styles.action} > {onStop ? ( <View style={[styles.stop, { backgroundColor: colors.danger }]} /> ) : ( <Icon name="settings" size={21} strokeWidth={1.4} /> )} </Touchable> </View> );}const styles = StyleSheet.create({ header: { minHeight: 64, paddingHorizontal: space.md, paddingVertical: space.sm, flexDirection: "row", alignItems: "center", gap: space.sm, }, identity: { flex: 1, alignItems: "center", gap: 4 }, wordmark: { fontFamily: "Around_400Regular", fontSize: 24, lineHeight: 30, letterSpacing: 1, }, status: { flexDirection: "row", alignItems: "center", gap: 6 }, action: { width: 44, height: 44, alignItems: "center", borderRadius: 22 }, stop: { width: 12, height: 12, borderRadius: 3 },});