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 / close-button / close-button.tsx
33 lines · 866 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 pane's close control (ReplDiffSidebar's PanelCloseButton): a `✕` at
10 * the header's right edge that closes the pane as `/diff` does.
11 *
12 * Bold under the pointer, as the built-in's is. The built-in's rest style,
13 * dim, is not a Button's to take: its label's only style is `hover`.
14 *
15 * @param kit the drawing's kit; its handlers close the pane
16 * @returns the control, in the keyed Box its hover needs
17 */
18export function closeButton(kit: Kit): RenderElement {
19 const { Box, Button } = kit.ui
20
21 return (
22 <Box key="close">
23 <Button
24 key="close"
25 plain
26 hover={{ bold: true }}
27 onPress={kit.actions.close}
28 >
29 {'✕'}
30 </Button>
31 </Box>
32 )
33}