Download IMDB-clone-react-redux/src/components/elements/FourColGrid/FourColGrid.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/IMDB-clone-react-redux/src/components/elements/FourColGrid/FourColGrid.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/IMDB-clone-react-redux/src/components/elements/FourColGrid/FourColGrid.js
-
curl -L -o FourColGrid.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/IMDB-clone-react-redux/src/components/elements/FourColGrid/FourColGrid.js
666 Bytes
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import './FourColGrid.css'; | |
| const FourColGrid = ({ header, loading, children }) => { | |
| const renderElements = () => { | |
| const gridElements = children.map( (element, i) => ( | |
| <div key={i} className="rmdb-grid-element"> | |
| {element} | |
| </div> | |
| )) | |
| return gridElements; | |
| } | |
| return ( | |
| <div className="rmdb-grid"> | |
| {header && !loading ? <h1>{header}</h1> : null} | |
| <div className="rmdb-grid-content"> | |
| {renderElements()} | |
| </div> | |
| </div> | |
| ) | |
| } | |
| FourColGrid.propTypes = { | |
| header: PropTypes.string, | |
| loading: PropTypes.bool | |
| } | |
| export default FourColGrid; |