| 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 | } |