spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / views / pane-view.tsx
24 lines · 779 BRaw
1/* @jsxRuntime classic */
2/* @jsx h */
3/* @jsxFrag Fragment */
4import type { RenderElement } from 'claude-code'
5
6import PaneState from '../pane-state'
7import { currentPane } from './current-pane'
8import type { Kit } from './kit'
9import { turnPane } from './turn-pane'
10
11/**
12 * The diff pane's body for one `ui.render`: the repository's diff now, or
13 * the picked turn's edits while that turn still exists (a rewind drops it).
14 *
15 * @param kit the elements, the handlers, the width
16 * @param model the pane's state
17 * @returns the tree
18 */
19export function paneView(kit: Kit, model: PaneState.PaneModel): RenderElement {
20 const turn = PaneState.pickedTurnOf(model)
21 const isCurrent = turn === undefined
22
23 return isCurrent ? currentPane(kit, model) : turnPane(kit, model, turn)
24}