()
| 39 | }); |
| 40 | |
| 41 | const addAnimal = () => { |
| 42 | const possibleAnimals = ['Dog', 'Cat', 'Iguana', 'Zebra']; |
| 43 | const selectedAnimal = possibleAnimals[Math.floor(Math.random() * possibleAnimals.length)]; |
| 44 | const newRef = push(animalsRef); |
| 45 | set(newRef, { commonName: selectedAnimal }); |
| 46 | }; |
| 47 | |
| 48 | if (status === 'loading') { |
| 49 | return <LoadingSpinner />; |