1 | import React from 'react'
|
2 | import PropTypes from 'prop-types'
|
3 |
|
4 | const OS_FULL_TEXT = 'One Size'
|
5 |
|
6 | const QuickAddSize = ({
|
7 | checked = false,
|
8 | children,
|
9 | className,
|
10 | id,
|
11 | input = {},
|
12 | quickAdd
|
13 | }) => {
|
14 | let label = ''
|
15 | if (children === 'OS') {
|
16 | label = OS_FULL_TEXT
|
17 | } else {
|
18 | label = children
|
19 | }
|
20 | return (
|
21 | <div className={className}>
|
22 | <input
|
23 | id={input.name}
|
24 | type='button'
|
25 | {...input}
|
26 | />
|
27 | <label
|
28 | htmlFor={input.name}>
|
29 | {label}
|
30 | </label>
|
31 | </div>
|
32 | )
|
33 | }
|
34 |
|
35 | QuickAddSize.propTypes = {
|
36 | checked: PropTypes.bool,
|
37 | children: PropTypes.string,
|
38 | className: PropTypes.string,
|
39 | id: PropTypes.string,
|
40 | input: PropTypes.object
|
41 | }
|
42 |
|
43 | export default QuickAddSize
|