import { FlatList, Pressable, Text, View } from 'react-native' import { ChevronLeft, ListChecks, MoreHorizontal } from 'lucide-react-native' import { colors } from '../theme/mobile-theme' import type { MobileDiffReviewQueueFilter } from '../session/mobile-diff-review-queue' import { REVIEW_FILTERS, mobileReviewCountLabel } from '../session/mobile-diff-review-screen-model' import { shouldShowTrigger } from './mobile-pr-sidebar-presentation' import { mobileDiffReviewStyles as styles } from './mobile-diff-review-screen-styles' type Props = { filter: MobileDiffReviewQueueFilter isWideLayout: boolean prSidebarIsGithubRepo: boolean prSidebarCanDock: boolean queueLength: number reviewedCount: number unsentCount: number worktreeLabel: string onBack: () => void onOpenActions: () => void onOpenPRSidebar: () => void onSelectFilter: (filter: MobileDiffReviewQueueFilter) => void } export function MobileDiffReviewHeader({ filter, isWideLayout, prSidebarIsGithubRepo, prSidebarCanDock, queueLength, reviewedCount, unsentCount, worktreeLabel, onBack, onOpenActions, onOpenPRSidebar, onSelectFilter }: Props) { // The dedicated PR icon appears on any GitHub repo in narrow/overlay mode; in wide // mode the sidebar is docked, so it is hidden (not disabled). const showPRTrigger = shouldShowTrigger({ isGithubRepo: prSidebarIsGithubRepo, isWideLayout, canDock: prSidebarCanDock }) return ( [styles.iconButton, pressed && styles.iconButtonPressed]} onPress={onBack} accessibilityRole="button" accessibilityLabel="Back" > Changes {worktreeLabel} {showPRTrigger ? ( [styles.iconButton, pressed && styles.iconButtonPressed]} onPress={onOpenPRSidebar} accessibilityRole="button" accessibilityLabel="Open pull request sidebar" > ) : null} [styles.iconButton, pressed && styles.iconButtonPressed]} onPress={onOpenActions} accessibilityRole="button" accessibilityLabel="Open review actions" > {reviewedCount}/{queueLength} reviewed {mobileReviewCountLabel(unsentCount, 'unsent note', 'unsent notes')} item} contentContainerStyle={styles.filterRow} renderItem={({ item }) => ( [ styles.filterChip, filter === item && styles.filterChipActive, pressed && styles.filterChipPressed ]} onPress={() => onSelectFilter(item)} accessibilityRole="button" accessibilityState={{ selected: filter === item }} accessibilityLabel={`Show ${item} review files`} > {item === 'all' ? 'All' : item[0]?.toUpperCase() + item.slice(1)} )} /> ) }