(props)
| 29 | } |
| 30 | |
| 31 | function Dropzone(props) { |
| 32 | const { onDrop, accept, fullHeight, children, classes, style, theme } = props; |
| 33 | const { |
| 34 | getRootProps, |
| 35 | getInputProps, |
| 36 | isDragAccept, |
| 37 | isDragReject |
| 38 | } = useDropzone({ |
| 39 | accept: accept, |
| 40 | onDrop: onDrop |
| 41 | }); |
| 42 | return ( |
| 43 | <Box {...getRootProps()} height="100%"> |
| 44 | <input {...getInputProps()} /> |
| 45 | <ColoredButton |
| 46 | fullWidth |
| 47 | className={classNames( |
| 48 | fullHeight ? classes.fullHeight : null, |
| 49 | classes.button |
| 50 | )} |
| 51 | variant="outlined" |
| 52 | color={getColor(isDragAccept, isDragReject, theme)} |
| 53 | style={style} |
| 54 | > |
| 55 | {children} |
| 56 | </ColoredButton> |
| 57 | </Box> |
| 58 | ); |
| 59 | } |
| 60 | |
| 61 | Dropzone.propTypes = { |
| 62 | classes: PropTypes.object.isRequired, |
nothing calls this directly
no outgoing calls
no test coverage detected