mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 03:15:01 +00:00
* refactor(mobile): give relay and encryption concrete owners * refactor(mobile): organize session and review feature owners * refactor(mobile): organize RPC and host ownership * test(mobile): point render fixtures at concrete owners * refactor(mobile): use explicit type-only owner imports
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { useHostDisplay, type HostDisplaySource } from '../transport/hosts/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)}`}
|
|
/>
|
|
)
|
|
}
|