/**
* Selectable list row with › marker + cyan focus.
*/
import { Text } from "ink";
import type { ReactElement } from "react";
import { TUI_ACCENT, TUI_MUTED } from "../theme.ts";
/** Props for {@link SelectRow}. */
export type SelectRowProps = {
readonly label: string;
readonly selected: boolean;
readonly enabled?: boolean;
};
/**
* One navigable action/list row.
*
* @param props - Label + selection
*/
export function SelectRow(props: SelectRowProps): ReactElement {
const enabled = props.enabled !== false;
if (!enabled) {
return (
{props.selected ? "› " : " "}
{props.label}
);
}
return (
{props.selected ? "› " : " "}
{props.label}
);
}