()
| 5 | import classes from './DropzoneButton.module.css'; |
| 6 | |
| 7 | export function DropzoneButton() { |
| 8 | const theme = useMantineTheme(); |
| 9 | const openRef = useRef<() => void>(null); |
| 10 | |
| 11 | return ( |
| 12 | <div className={classes.wrapper}> |
| 13 | <Dropzone |
| 14 | openRef={openRef} |
| 15 | onDrop={() => {}} |
| 16 | className={classes.dropzone} |
| 17 | radius="md" |
| 18 | accept={[MIME_TYPES.pdf]} |
| 19 | maxSize={30 * 1024 ** 2} |
| 20 | aria-label="Drop files here" |
| 21 | > |
| 22 | <div style={{ pointerEvents: 'none' }}> |
| 23 | <Group justify="center"> |
| 24 | <Dropzone.Accept> |
| 25 | <IconDownload size={50} color={theme.colors.blue[6]} stroke={1.5} /> |
| 26 | </Dropzone.Accept> |
| 27 | <Dropzone.Reject> |
| 28 | <IconX size={50} color={theme.colors.red[6]} stroke={1.5} /> |
| 29 | </Dropzone.Reject> |
| 30 | <Dropzone.Idle> |
| 31 | <IconCloudUpload size={50} stroke={1.5} className={classes.icon} /> |
| 32 | </Dropzone.Idle> |
| 33 | </Group> |
| 34 | |
| 35 | <Text ta="center" fw={700} fz="lg" mt="xl"> |
| 36 | <Dropzone.Accept>Drop files here</Dropzone.Accept> |
| 37 | <Dropzone.Reject>Pdf file less than 30mb</Dropzone.Reject> |
| 38 | <Dropzone.Idle>Upload resume</Dropzone.Idle> |
| 39 | </Text> |
| 40 | |
| 41 | <Text className={classes.description}> |
| 42 | Drag'n'drop files here to upload. We can accept only <i>.pdf</i> files that |
| 43 | are less than 30mb in size. |
| 44 | </Text> |
| 45 | </div> |
| 46 | </Dropzone> |
| 47 | |
| 48 | <Button className={classes.control} size="md" radius="xl" onClick={() => openRef.current?.()}> |
| 49 | Select files |
| 50 | </Button> |
| 51 | </div> |
| 52 | ); |
| 53 | } |
nothing calls this directly
no outgoing calls
no test coverage detected