(
props: ModalProps & { shouldClarify: boolean },
)
| 124 | } |
| 125 | |
| 126 | export function ClarifyCloseModal( |
| 127 | props: ModalProps & { shouldClarify: boolean }, |
| 128 | ) { |
| 129 | const [clarify, setClarify] = useState(false); |
| 130 | |
| 131 | return ( |
| 132 | <> |
| 133 | <Modal |
| 134 | {...{ |
| 135 | ...props, |
| 136 | // Show the clarify modal |
| 137 | setOpen: () => |
| 138 | props.shouldClarify ? setClarify(true) : props.setOpen(false), |
| 139 | }} |
| 140 | > |
| 141 | {props.children} |
| 142 | </Modal> |
| 143 | <WarningModal |
| 144 | open={clarify} |
| 145 | setOpen={setClarify} |
| 146 | title={"Discard changes"} |
| 147 | description={ |
| 148 | "There are unsaved changes. Are you sure you want to discard them?" |
| 149 | } |
| 150 | actionName={"Discard"} |
| 151 | action={() => props.setOpen(false)} |
| 152 | /> |
| 153 | </> |
| 154 | ); |
| 155 | } |
nothing calls this directly
no outgoing calls
no test coverage detected