/
GridLi.jsx
53 lines (48 loc) · 1.15 KB
/
GridLi.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { h } from 'preact'
function GridListItem (props) {
const {
className,
isDisabled,
restrictionError,
isChecked,
title,
itemIconEl,
showTitles,
toggleCheckbox,
recordShiftKeyPress,
id,
children,
} = props
return (
<li
className={className}
title={isDisabled ? restrictionError?.message : null}
>
<input
type="checkbox"
className={`uppy-u-reset uppy-ProviderBrowserItem-checkbox ${
isChecked ? 'uppy-ProviderBrowserItem-checkbox--is-checked' : ''
} uppy-ProviderBrowserItem-checkbox--grid`}
onChange={toggleCheckbox}
onKeyDown={recordShiftKeyPress}
name="listitem"
id={id}
checked={isChecked}
disabled={isDisabled}
data-uppy-super-focusable
/>
<label
htmlFor={id}
aria-label={title}
className="uppy-u-reset uppy-ProviderBrowserItem-inner"
>
<span className="uppy-ProviderBrowserItem-inner-relative">
{itemIconEl}
{showTitles && title}
{children}
</span>
</label>
</li>
)
}
export default GridListItem