| 1 |
import React from 'react'; |
| 2 |
|
| 3 |
import { __wpupg } from 'Shared/Translations'; |
| 4 |
import FieldDropdown from '../field/FieldDropdown'; |
| 5 |
|
| 6 |
const SelectGrid = (props) => { |
| 7 |
let gridOptions = []; |
| 8 |
|
| 9 |
for ( let grid of wpupg_admin.grids ) { |
| 10 |
gridOptions.push({ |
| 11 |
value: grid.slug, |
| 12 |
label: `${ grid.id } - ${ grid.name || 'n/a' }`, |
| 13 |
}); |
| 14 |
} |
| 15 |
return ( |
| 16 |
<FieldDropdown |
| 17 |
value={ props.value } |
| 18 |
placeholder={ props.placeholder } |
| 19 |
onChange={ props.onChange } |
| 20 |
options={gridOptions} |
| 21 |
/> |
| 22 |
); |
| 23 |
} |
| 24 |
export default SelectGrid; |
| 25 |
|