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.6 KB
Raw Blame
import { withWorkspaceRoute } from '../../../../src/navigation/workspace-route'
import { useLocalSearchParams } from 'expo-router'
import { MobileSourceControlPanel } from '../../../../src/source-control/MobileSourceControlPanel'
import { firstParam } from '../../../../src/navigation/route-param-reader'
import { parseSourceControlHubTab } from '../../../../src/source-control/mobile-source-control-hub-tab'
import { useSessionScreenHandlers } from '../../../../src/session/session-screen-handlers'

// Render screen directly: native sibling imports a shell module that throws in browsers, and manifest imports every route.
export default withWorkspaceRoute(function MobileSourceControlScreen() {
  // Match native firstParam handling even though init.route.params currently guarantees strings.
  const params = useLocalSearchParams<{
    hostId?: string | string[]
    worktreeId?: string | string[]
    name?: string | string[]
    origin?: string | string[]
    tab?: string | string[]
  }>()
  const hostId = firstParam(params.hostId)
  const worktreeId = firstParam(params.worktreeId)
  const origin = firstParam(params.origin)
  const session = useSessionScreenHandlers(hostId, worktreeId)
  return (
    <MobileSourceControlPanel
      hostId={hostId}
      worktreeId={worktreeId}
      name={firstParam(params.name)}
      origin={origin}
      initialTab={parseSourceControlHubTab(firstParam(params.tab))}
      embedded={false}
      {...(origin === 'session' && session
        ? { onFileOpenStart: session.onFileOpenStart, onOpenedFileDiff: session.onOpenedFileDiff }
        : undefined)}
    />
  )
})