Skip to content

components/PanelRows

import { … } from 'zidane-ui'ui/src/components/PanelRows.tsx

Breadcrumb (long path truncates left)
EditableTitle (double-click)
Rate limit the chat endpoint
DiffCounts, RowBadge, Highlighted
+14−2+120−8mergeddraft3 filessession-title.ts
SegmentSpinner
ZidaneMark
WorkingWorkingWorkingWorking

Components#

DiffCountsComponent#

+120 −8 with the halves colored like a diff, in the meta voice.

TypeScript
function DiffCounts(props: DiffCountsProps): Element
Parameters
NameTypeDescription
propsDiffCountsProps

Component props.

Element
DiffCounts props
NameTypeDescription
addednumber

Number of added lines, shown as +N in the success colour.

className?string

Extra classes on the wrapping element.

removednumber

Number of removed lines, shown as -N in the danger colour.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/components/PanelRows.tsx:39

RowBadgeComponent#

A small status chip set into the row. A diff badge reading +N −M renders as DiffCounts.

TypeScript
function RowBadge(props: RowBadgeProps): Element
Parameters
NameTypeDescription
propsRowBadgeProps

Component props.

Element
RowBadge props
NameTypeDescription
className?string

Extra classes on the root element.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

textstring

Badge text. With tone="diff", text shaped like +12 -3 renders as DiffCounts.

title?string

Native tooltip.

tone?BadgeTone

Colour of the text. See BadgeTone.

ui/src/components/PanelRows.tsx:67

Constants#

PANEL_ROWConstant#

A flat list row: no fill until hovered, bleeding into the list's padding.

TypeScript
const PANEL_ROW: 'relative flex items-start gap-2 -mx-2 px-2 py-1.5 rounded-zg-md'

ui/src/components/PanelRows.tsx:9

PANEL_ROW_HOVERConstant#

Class that adds the hover fill to a PANEL_ROW. Left separate for rows that supply their own hover.

TypeScript
const PANEL_ROW_HOVER = 'hover:bg-[var(--zg-row-hover)]'

ui/src/components/PanelRows.tsx:14

Interfaces#

DiffCountsPropsInterface#

Props for DiffCounts.

TypeScript
interface DiffCountsProps
DiffCountsProps properties
NameTypeDescription
addednumber

Number of added lines, shown as +N in the success colour.

className?string

Extra classes on the wrapping element.

removednumber

Number of removed lines, shown as -N in the danger colour.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/components/PanelRows.tsx:23

RowBadgePropsInterface#

Props for RowBadge.

TypeScript
interface RowBadgeProps
RowBadgeProps properties
NameTypeDescription
className?string

Extra classes on the root element.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

textstring

Badge text. With tone="diff", text shaped like +12 -3 renders as DiffCounts.

title?string

Native tooltip.

tone?BadgeTone

Colour of the text. See BadgeTone.

ui/src/components/PanelRows.tsx:49

Types#

BadgeToneType#

Colour of a RowBadge: neutral (or none) is muted, success and warn take their status colour, and diff is monospaced text for +N -M counts.

TypeScript
type BadgeTone = 'neutral' | 'diff' | 'success' | 'warn' | undefined

ui/src/components/PanelRows.tsx:20