Download react-boilerplate/app/components/ReposList/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 800 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/app/components/ReposList/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-boilerplate/app/components/ReposList/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/app/components/ReposList/index.js
800 Bytes
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import List from 'components/List'; | |
| import ListItem from 'components/ListItem'; | |
| import LoadingIndicator from 'components/LoadingIndicator'; | |
| import RepoListItem from 'containers/RepoListItem'; | |
| function ReposList({ loading, error, repos }) { | |
| if (loading) { | |
| return <List component={LoadingIndicator} />; | |
| } | |
| if (error !== false) { | |
| const ErrorComponent = () => ( | |
| <ListItem item="Something went wrong, please try again!" /> | |
| ); | |
| return <List component={ErrorComponent} />; | |
| } | |
| if (repos !== false) { | |
| return <List items={repos} component={RepoListItem} />; | |
| } | |
| return null; | |
| } | |
| ReposList.propTypes = { | |
| loading: PropTypes.bool, | |
| error: PropTypes.any, | |
| repos: PropTypes.any, | |
| }; | |
| export default ReposList; | |