MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Completed

Function Completed

examples/rsp-webpack-4/src/Completed.js:6–35  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

4import {Flex} from '@adobe/react-spectrum';
5
6function 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
37export default Completed;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected