| | |
| | | import { ALLOW_FILE_EXTENSIONS } from '@/types/app' |
| | | |
| | | type UploaderProps = { |
| | | children: (hovering: boolean) => React.JSX.Element |
| | | children: (hovering: boolean) => JSX.Element |
| | | onUpload: (imageFile: ImageFile) => void |
| | | closePopover?: () => void |
| | | limit?: number |
| | |
| | | > |
| | | {children(hovering)} |
| | | <input |
| | | className='absolute inset-0 block w-full cursor-pointer text-[0] opacity-0 disabled:cursor-not-allowed' |
| | | className='absolute block inset-0 opacity-0 text-[0] w-full disabled:cursor-not-allowed cursor-pointer' |
| | | onClick={e => ((e.target as HTMLInputElement).value = '')} |
| | | type='file' |
| | | accept={ALLOW_FILE_EXTENSIONS.map(ext => `.${ext}`).join(',')} |