| 63 | } |
| 64 | |
| 65 | func renderCreateSuccess(resp **api.CreateInstanceResponse) func() string { |
| 66 | return func() string { |
| 67 | headerStyle := theme.Primary().Bold(true) |
| 68 | labelStyle := theme.Neutral() |
| 69 | valueStyle := lipgloss.NewStyle().Bold(true) |
| 70 | cmdStyle := theme.Neutral() |
| 71 | boxStyle := lipgloss.NewStyle(). |
| 72 | Border(lipgloss.RoundedBorder()). |
| 73 | BorderForeground(lipgloss.Color(theme.PrimaryColor)). |
| 74 | Padding(1, 2) |
| 75 | |
| 76 | var lines []string |
| 77 | successTitleStyle := theme.Success() |
| 78 | lines = append(lines, successTitleStyle.Render("✓ Instance created successfully!")) |
| 79 | lines = append(lines, "") |
| 80 | lines = append(lines, labelStyle.Render("Instance ID:")+" "+valueStyle.Render(fmt.Sprintf("%d", (*resp).Identifier))) |
| 81 | lines = append(lines, "") |
| 82 | lines = append(lines, headerStyle.Render("Next steps:")) |
| 83 | lines = append(lines, cmdStyle.Render(" • Run 'tnr status' to monitor provisioning progress")) |
| 84 | lines = append(lines, cmdStyle.Render(fmt.Sprintf(" • Run 'tnr connect %d' once the instance is RUNNING", (*resp).Identifier))) |
| 85 | |
| 86 | content := lipgloss.JoinVertical(lipgloss.Left, lines...) |
| 87 | return "\n" + boxStyle.Render(content) + "\n\n" |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func buildCreatePresets(cmd *cobra.Command) *tui.CreatePresets { |
| 92 | p := &tui.CreatePresets{} |