| 289 | } |
| 290 | |
| 291 | func (m snapshotListModel) formatStatus(status string, width int) string { |
| 292 | var style lipgloss.Style |
| 293 | switch status { |
| 294 | case "READY": |
| 295 | style = m.styles.ready |
| 296 | case "CREATING": |
| 297 | style = m.styles.creating |
| 298 | case "FAILED": |
| 299 | style = m.styles.failed |
| 300 | default: |
| 301 | style = lipgloss.NewStyle() |
| 302 | } |
| 303 | return style.Render(truncate(status, width)) |
| 304 | } |
| 305 | |
| 306 | func RunSnapshotList(client *api.Client, monitoring bool, snapshots api.ListSnapshotsResponse) error { |
| 307 | ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) |