pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 1 | import react, { Component } from "react"; |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 2 | import Styles from '../styles/autospacing.module.css'; |
| 3 | |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 4 | class AutoSpacing extends Component { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 5 | constructor(props) { |
| 6 | super(props); |
| 7 | } |
| 8 | |
| 9 | |
| 10 | render() { |
| 11 | return ( |
| 12 | <div className={Styles.container}> |
| 13 | { |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 14 | react.Children.toArray(this.props.children).map((item, index) => { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 15 | return <div className={Styles.item} key={index}>{item}</div> |
| 16 | }) |
| 17 | } |
| 18 | </div> |
| 19 | ) |
| 20 | } |
| 21 | } |
| 22 | |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 23 | export default AutoSpacing; |