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 / title-row.tsx
33 lines · 824 BRaw
1/* @jsxRuntime classic */
2/* @jsx h */
3/* @jsxFrag Fragment */
4import type { RenderElement } from 'claude-code'
5
6import type PaneState from '../../pane-state'
7import type { Kit } from '../kit'
8import Layout from '../layout'
9
10/**
11 * The inline pane's heading (DiffDialog's title line): the title, then
12 * its subtitle in dim after a space.
13 *
14 * @param kit the elements and the width
15 * @param heading the title and subtitle
16 * @returns the row
17 */
18export function titleRow(
19 kit: Kit,
20 heading: PaneState.DialogTitle,
21): RenderElement {
22 const { Text } = kit.ui
23 const hasSubtitle = heading.subtitle !== ''
24
25 return (
26 <Text wrap="truncate-end">
27 {Layout.sanitizeName(heading.title)}
28 <Text dimColor>
29 {hasSubtitle ? ` ${Layout.sanitizeName(heading.subtitle)}` : ''}
30 </Text>
31 </Text>
32 )
33}