MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / render

Method render

crates/opencode-tui/src/components/todo_item.rs:24–40  ·  view source on GitHub ↗
(&self, frame: &mut Frame, area: Rect)

Source from the content-addressed store, hash-verified

22 }
23
24 pub fn render(&self, frame: &mut Frame, area: Rect) {
25 let (icon, color) = match &self.status {
26 TodoStatus::Pending => ("○", ratatui::style::Color::Gray),
27 TodoStatus::InProgress => ("◐", ratatui::style::Color::Yellow),
28 TodoStatus::Completed => ("●", ratatui::style::Color::Green),
29 TodoStatus::Cancelled => ("○", ratatui::style::Color::DarkGray),
30 };
31
32 let line = Line::from(vec![
33 Span::styled(icon, Style::default().fg(color)),
34 Span::raw(" "),
35 Span::styled(&self.content, Style::default()),
36 ]);
37
38 let paragraph = Paragraph::new(line);
39 frame.render_widget(paragraph, area);
40 }
41}

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected