/** * CompareBar * * Displays PREV/CUR comparison metadata for diff view. * Shows event labels, timestamps, badges, and optional navigation controls. * This is a dumb component - all state is controlled externally. */ import React, { memo } from "react"; import { View, Text, TouchableOpacity, StyleSheet } from "react-native"; import { macOSColors } from "../../gameUI/constants/macOSDesignSystemColors"; import { ChevronLeft, ChevronRight } from "../../../icons/lucide-icons"; import type { CompareBarProps } from "./types"; /** * CompareBar displays a side-by-side comparison of two events * with optional navigation controls for any-to-any compare mode. */ export const CompareBar = memo(function CompareBar({ leftEvent, rightEvent, showNavigation = false, onLeftPrevious, onLeftNext, onRightPrevious, onRightNext, canLeftPrevious = false, canLeftNext = false, canRightPrevious = false, canRightNext = false, onLeftPress, onRightPress, }: CompareBarProps) { return ( {/* Left (PREV) side */} PREV {leftEvent.badge} {showNavigation && ( )} {leftEvent.label} {leftEvent.timestamp} ({leftEvent.relativeTime}) {showNavigation && ( )} {/* Right (CUR) side */} CUR {rightEvent.badge} {showNavigation && ( )} {rightEvent.label} {rightEvent.timestamp} ({rightEvent.relativeTime}) {showNavigation && ( )} ); }); const styles = StyleSheet.create({ container: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", backgroundColor: macOSColors.background.card, borderWidth: 1, borderColor: macOSColors.border.default, borderRadius: 6, paddingHorizontal: 8, paddingVertical: 6, marginBottom: 8, gap: 8, }, side: { flex: 1, }, labelRow: { flexDirection: "row", alignItems: "center", gap: 6, marginBottom: 2, }, label: { fontSize: 10, fontFamily: "monospace", fontWeight: "700", letterSpacing: 0.5, textTransform: "uppercase", }, labelPrev: { color: macOSColors.semantic.debug, }, labelCur: { color: macOSColors.semantic.success, }, controls: { flexDirection: "row", alignItems: "center", gap: 6, }, navBtn: { width: 26, height: 26, borderRadius: 6, backgroundColor: macOSColors.background.card, borderWidth: 1, borderColor: macOSColors.border.default, alignItems: "center", justifyContent: "center", }, navBtnDisabled: { opacity: 0.4, }, meta: { flex: 1, }, index: { fontSize: 10, color: macOSColors.text.secondary, fontFamily: "monospace", }, time: { fontSize: 11, color: macOSColors.text.primary, fontFamily: "monospace", }, relative: { fontSize: 10, color: macOSColors.text.secondary, fontFamily: "monospace", }, divider: { width: 1, height: 34, backgroundColor: macOSColors.background.input, }, });