File size: 828 Bytes
c9c900b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | /* @jsxRuntime classic */
/* @jsx h */
/* @jsxFrag Fragment */
import type { RenderElement } from 'claude-code'
import type { Kit } from '../kit'
import type { Pressable } from './pressable'
/**
* A clickable line that shows or hides a group (ReplDiffSidebar's
* NoiseFilterToggle and pre-session header), as a plain Button.
*
* @param kit the drawing's kit; its elements draw the row
* @param key the Button's address
* @param pressable the line's text, `(show)` or `(hide)` in it, and its press
* @returns the row
*/
export function toggleRow(
kit: Kit,
key: string,
pressable: Pressable,
): RenderElement {
const { Box, Button } = kit.ui
return (
<Box flexDirection="row">
<Button key={key} plain dimColor onPress={pressable.onPress}>
{pressable.label}
</Button>
</Box>
)
}
|