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 / sections / list-edge-button / list-edge-button.tsx
36 lines · 860 BRaw
1/* @jsxRuntime classic */
2/* @jsx h */
3/* @jsxFrag Fragment */
4import type { RenderElement } from 'claude-code'
5
6import type { Kit } from '../../kit'
7
8/**
9 * The docked list's `more above` or `more below` row as a dim plain Button
10 * that moves its window a file, under the built-in's list keys too.
11 *
12 * @param kit the elements and the handlers
13 * @param edge which edge, the Button's key
14 * @param label the row's text
15 * @returns the Button
16 */
17export function listEdgeButton(
18 kit: Kit,
19 edge: 'list-up' | 'list-down',
20 label: string,
21): RenderElement {
22 const { Button } = kit.ui
23 const isUp = edge === 'list-up'
24
25 return (
26 <Button
27 key={edge}
28 plain
29 dimColor
30 action={isUp ? 'app:diffFileListUp' : 'app:diffFileListDown'}
31 onPress={() => kit.actions.scrollList(isUp ? -1 : 1)}
32 >
33 {label}
34 </Button>
35 )
36}