(props)
| 4 | import {Flex} from '@adobe/react-spectrum'; |
| 5 | |
| 6 | function Completed(props) { |
| 7 | const elements = props.completed.map(item => ( |
| 8 | <Checkbox isReadOnly isSelected key={item.id}> |
| 9 | {item.task} |
| 10 | </Checkbox> |
| 11 | )); |
| 12 | |
| 13 | let alertCancel = () => alert('Cancel button pressed.'); |
| 14 | |
| 15 | return ( |
| 16 | <Flex direction="column"> |
| 17 | {elements} |
| 18 | <DialogTrigger> |
| 19 | <ActionButton marginTop="size-100" marginEnd="auto"> |
| 20 | <Delete aria-label="Delete" /> |
| 21 | </ActionButton> |
| 22 | <AlertDialog |
| 23 | variant="confirmation" |
| 24 | title="Delete Items" |
| 25 | primaryActionLabel="Delete" |
| 26 | cancelLabel="Cancel" |
| 27 | autoFocusButton="primary" |
| 28 | onPrimaryAction={props.onDelete} |
| 29 | onCancel={alertCancel}> |
| 30 | Are you sure you want to delete the completed tasks? |
| 31 | </AlertDialog> |
| 32 | </DialogTrigger> |
| 33 | </Flex> |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | export default Completed; |
nothing calls this directly
no outgoing calls
no test coverage detected