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.2 KB
Raw Blame
import { useHostDisplay, type HostDisplaySource } from '../transport/use-host-display'
import type { DownloadProgressFeed } from './download-progress-feed'
import { DownloadProgressBar, downloadedMegabytesCaption } from './DownloadProgressBar'
import type { MobileWebShellSessionState } from './mobile-web-shell-session-contract'
import { ShellWaitingFrame } from './ShellWaitingFrame'

const DOWNLOADING_LABEL = 'Downloading the latest app'

export function ShellDownloadProgress({
  state,
  feed,
  host
}: {
  state: Extract<MobileWebShellSessionState, { kind: 'fetching' }>
  feed: DownloadProgressFeed
  host: HostDisplaySource | null
}) {
  const hostTitle = useHostDisplay(host).title
  const source = host === null ? '' : `from ${hostTitle} · `
  return (
    <ShellWaitingFrame
      label={DOWNLOADING_LABEL}
      indicator={
        <DownloadProgressBar
          feed={feed}
          receivedBytes={state.receivedBytes}
          totalBytes={state.totalBytes}
          accessibilityLabel={DOWNLOADING_LABEL}
          testID="mobile-web-shell-progress-bar"
        />
      }
      caption={`${source}${downloadedMegabytesCaption(state.receivedBytes, state.totalBytes)}`}
    />
  )
}