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.

603 B
Raw Blame
import { formatPreviewByteLength } from '../files/mobile-file-preview-response'
import type { MarkdownDocState } from './mobile-session-route-types'

export function markdownReaderStatusText(
  doc: Extract<MarkdownDocState, { status: 'ready' }>
): string | null {
  if (doc.saveError) {
    return doc.saveError
  }
  if (doc.truncated) {
    return doc.byteLength === undefined
      ? 'Preview truncated.'
      : `Preview truncated. File size: ${formatPreviewByteLength(doc.byteLength)}.`
  }
  if (doc.readOnlyReason) {
    return 'Read only'
  }
  return doc.stale ? 'Changed on desktop' : null
}