Download react-hook-form/scripts/README/Previews/Individual.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/scripts/README/Previews/Individual.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/scripts/README/Previews/Individual.js
-
curl -L -o Individual.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-hook-form/scripts/README/Previews/Individual.js
399 Bytes
| import { toProfile, toAvatar } from 'Link'; | |
| export default function generate(individual) { | |
| const { github, avatar, alt } = individual; | |
| const lines = [ | |
| `<a href = '${toProfile(github)}'>`, | |
| ` <img`, | |
| ` width = 45`, | |
| ` src = '${toAvatar(avatar)}'`, | |
| ` />`, | |
| `</a>`, | |
| ]; | |
| if (alt) lines.slice(2, 0, ` alt = ${alt}`); | |
| return lines.join('\n'); | |
| } | |