Download spectrum/api/utils/get-random-default-photo.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/utils/get-random-default-photo.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/utils/get-random-default-photo.js
-
curl -L -o get-random-default-photo.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/utils/get-random-default-photo.js
434 Bytes
| // @flow | |
| const faker = require('faker'); | |
| // Helper function to get a random profile and cover photo | |
| const PALETTE = [ | |
| 'blue', | |
| 'blush', | |
| 'cool', | |
| 'green', | |
| 'orange', | |
| 'peach', | |
| 'pink', | |
| 'red', | |
| 'teal', | |
| 'violet', | |
| ]; | |
| export default () => { | |
| const color = faker.random.arrayElement(PALETTE); | |
| return { | |
| profilePhoto: `/default_images/profile-${color}.png`, | |
| coverPhoto: `/default_images/cover-${color}.svg`, | |
| }; | |
| }; | |