import { Box, Text } from "ink"; import type React from "react"; import { useTerminalWidth } from "../hooks/useTerminalWidth.js"; import { colors } from "./colors.js"; interface TodoItem { content: string; status: "pending" | "in_progress" | "completed"; id: string; priority?: "high" | "medium" | "low"; } interface TodoRendererProps { todos: TodoItem[]; } export const TodoRenderer: React.FC = ({ todos }) => { const columns = useTerminalWidth(); const prefixWidth = 5; // " ⎿ " or " " const contentWidth = Math.max(0, columns - prefixWidth); return ( {todos.map((todo, index) => { const checkbox = todo.status === "completed" ? "☒" : "☐"; // Format based on status let textElement: React.ReactNode; if (todo.status === "completed") { // Green with strikethrough textElement = ( {checkbox} {todo.content} ); } else if (todo.status === "in_progress") { // Blue bold (like code formatting) textElement = ( {checkbox} {todo.content} ); } else { // Plain text for pending textElement = ( {checkbox} {todo.content} ); } // First item gets the prefix, others get indentation const prefix = index === 0 ? " ⎿ " : " "; return ( {prefix} {textElement} ); })} ); };