Download web/src/components/DomainButtons.jsx from kphani007/Aegis: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/spaces/kphani007/Aegis/resolve/main/web/src/components/DomainButtons.jsx
- Command line
-
hf download hf://spaces/kphani007/Aegis/web/src/components/DomainButtons.jsx
-
curl -L -o DomainButtons.jsx https://huggingface.co/spaces/kphani007/Aegis/resolve/main/web/src/components/DomainButtons.jsx
569 Bytes
| function pickRandom(list) { | |
| return list[Math.floor(Math.random() * list.length)] | |
| } | |
| export default function DomainButtons({ categories, onPick }) { | |
| if (!categories.length) return null | |
| return ( | |
| <div className="domain-buttons"> | |
| {categories.map((category) => ( | |
| <button | |
| key={category.id} | |
| className={`domain-pill domain-pill--${category.id}`} | |
| title={category.description} | |
| onClick={() => onPick(pickRandom(category.questions))} | |
| > | |
| {category.label} | |
| </button> | |
| ))} | |
| </div> | |
| ) | |
| } | |