()
| 36 | }); |
| 37 | |
| 38 | const addAnimal = () => { |
| 39 | const possibleAnimals = ['Dog', 'Cat', 'Iguana', 'Zebra']; |
| 40 | const selectedAnimal = possibleAnimals[Math.floor(Math.random() * possibleAnimals.length)]; |
| 41 | const newRef = push(animalsRef); |
| 42 | set(newRef, { commonName: selectedAnimal }); |
| 43 | }; |
| 44 | |
| 45 | if (!animals) { |
| 46 | return <span>no animals found</span>; |