import React, { useEffect, useState } from 'react'; import Button from '@custom/shared/components/Button'; import { Card, CardBody, CardFooter, CardHeader, } from '@custom/shared/components/Card'; import Field from '@custom/shared/components/Field'; import { TextInput, BooleanInput, SelectInput } from '@custom/shared/components/Input'; import Well from '@custom/shared/components/Well'; import { slugify } from '@custom/shared/lib/slugify'; import PropTypes from 'prop-types'; /** * Intro * --- * Specify which room we would like to join */ export const Intro = ({ tokenError, fetching, error, onJoin, }) => { const [rooms, setRooms] = useState({}); const [duration, setDuration] = useState("30"); const [roomName, setRoomName] = useState(); const [privacy, setPrivacy] = useState(true); const fetchRooms = async () => { const res = await fetch('/api/presence', { method: 'GET', headers: { 'Content-Type': 'application/json', }, }); const resJson = await res.json(); setRooms(resJson); } useEffect(() => { fetchRooms(); const i = setInterval(fetchRooms, 15000); return () => clearInterval(i); }, []); return (
Looks like there's no class going on right now, start with creating one!
)} {Object.keys(rooms).map(room => ({error}
{tokenError}