indent wrapped todo items properly

This commit is contained in:
Sebastian Herrlinger
2025-12-23 15:44:45 +01:00
parent c81721e9fc
commit 1d9e181da0
3 changed files with 36 additions and 12 deletions
@@ -0,0 +1,32 @@
import { useTheme } from "../context/theme"
export interface TodoItemProps {
status: string
content: string
}
export function TodoItem(props: TodoItemProps) {
const { theme } = useTheme()
return (
<box flexDirection="row" gap={0}>
<text
flexShrink={0}
style={{
fg: props.status === "in_progress" ? theme.success : theme.textMuted,
}}
>
[{props.status === "completed" ? "✓" : " "}]{" "}
</text>
<text
flexGrow={1}
wrapMode="word"
style={{
fg: props.status === "in_progress" ? theme.success : theme.textMuted,
}}
>
{props.content}
</text>
</box>
)
}