1 | import React from 'react'
|
2 | import PropTypes from 'prop-types'
|
3 | import styled from 'styled-components'
|
4 |
|
5 | import PressIcon from 'SRC/core/icons/press/PressIcon'
|
6 |
|
7 | const IconRow = styled(({className, onClick, quotes, selected}) => {
|
8 | return (
|
9 | <div className={className}>
|
10 | {quotes.map((icon, index) => {
|
11 | const iconSelected = (index === selected)
|
12 | return (
|
13 | <PressIcon
|
14 | key={index}
|
15 | brand={quotes[index].id}
|
16 | onClick={onClick(index)}
|
17 | selected={iconSelected} />
|
18 | )
|
19 | })}
|
20 | </div>
|
21 | )
|
22 | })`
|
23 | display: flex;
|
24 | flex-wrap: wrap;
|
25 | ${PressIcon} {
|
26 | width: 25%;
|
27 | }
|
28 | `
|
29 |
|
30 | IconRow.propTypes = {
|
31 | iconsPerRow: PropTypes.number
|
32 | }
|
33 |
|
34 |
|
35 | export default IconRow
|