Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

1.1 KB
Raw Blame
import type { ReactNode } from 'react'
import { Text, View } from 'react-native'
import { mobilePrSidebarStyles as styles } from './mobile-pr-sidebar-styles'
import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme'

type Props = {
  // Omit header for self-explanatory action sections to save mobile space.
  title?: string
  // Right-align optional header controls opposite title.
  trailing?: ReactNode
  children: ReactNode
}

// Use consistent desktop-style section/header divider; omit header only when title and trailing controls both absent.
export function PRSection({ title, trailing, children }: Props) {
  useMobileColorScheme()
  const showHeader = Boolean(title) || trailing != null
  return (
    <View style={styles.section}>
      {showHeader ? (
        <View style={styles.sectionHeader}>
          {title ? <Text style={styles.sectionLabel}>{title}</Text> : null}
          {trailing ? <View style={styles.sectionHeaderTrailing}>{trailing}</View> : null}
        </View>
      ) : null}
      <View style={styles.sectionBody}>{children}</View>
    </View>
  )
}