()
| 212 | }); |
| 213 | |
| 214 | const content = () => { |
| 215 | const confirmingIndex = confirming(); |
| 216 | const Component = isUndefined(confirmingIndex) |
| 217 | ? undefined |
| 218 | : props.actions[confirmingIndex][2]; |
| 219 | return ( |
| 220 | <> |
| 221 | {Component ? ( |
| 222 | <> |
| 223 | {Component({...props, onDone: handleDone})} |
| 224 | <img onClick={handleDone} title="Cancel" class="cancel" /> |
| 225 | </> |
| 226 | ) : ( |
| 227 | arrayMap(props.actions, ([icon, title], index) => ( |
| 228 | <img |
| 229 | title={title} |
| 230 | class={icon} |
| 231 | onClick={() => setConfirming(index)} |
| 232 | /> |
| 233 | )) |
| 234 | )} |
| 235 | </> |
| 236 | ); |
| 237 | }; |
| 238 | |
| 239 | return <>{content()}</>; |
| 240 | }; |
no test coverage detected
searching dependent graphs…