(status: 'read' | 'unread')
| 70 | } |
| 71 | |
| 72 | function markForm(status: 'read' | 'unread'): JSX.Element { |
| 73 | const form = $(`form[data-status="${status}"]`); |
| 74 | form.id ||= `rgh-mark-${status}-form`; |
| 75 | const icon = $('.mr-1:has(svg)', form).cloneNode(true); |
| 76 | return ( |
| 77 | <button |
| 78 | className='d-flex justify-content-center align-items-center btn btn-sm mr-2' |
| 79 | form={form.id} |
| 80 | type="submit"> |
| 81 | {icon} |
| 82 | {/* Spaces collapsed, use mr-1 to space words */} |
| 83 | <span className="not-sm-sr-only sr-only mr-1">Mark as</span> |
| 84 | {upperCaseFirst(status)} |
| 85 | </button> |
| 86 | ); |
| 87 | } |
| 88 | |
| 89 | function unwrapActions(details: HTMLDetailsElement): void { |
| 90 | details.before(markForm('read'), markForm('unread')); |
no test coverage detected