(userBlocks []*management.UserBlock)
| 30 | } |
| 31 | |
| 32 | func (r *Renderer) UserBlocksList(userBlocks []*management.UserBlock) { |
| 33 | resource := "user blocks" |
| 34 | |
| 35 | r.Heading(resource) |
| 36 | |
| 37 | if len(userBlocks) == 0 { |
| 38 | r.EmptyState(resource, "") |
| 39 | return |
| 40 | } |
| 41 | |
| 42 | var res []View |
| 43 | |
| 44 | for _, userBlock := range userBlocks { |
| 45 | res = append(res, &userBlockView{ |
| 46 | Identifier: *userBlock.Identifier, |
| 47 | IP: *userBlock.IP, |
| 48 | raw: userBlock, |
| 49 | }) |
| 50 | } |
| 51 | |
| 52 | r.Results(res) |
| 53 | } |
no test coverage detected