diff --git a/src/Schedule.jsx b/src/Schedule.jsx new file mode 100644 index 0000000..b278beb --- /dev/null +++ b/src/Schedule.jsx @@ -0,0 +1,13 @@ +import PropTypes from 'prop-types'; + +export default function Schedule({ + conferenceId, +}) { + return (<> + conference id: {conferenceId} + ); +} + +Schedule.propTypes = { + conferenceId: PropTypes.string.isRequired, +}; diff --git a/src/ScheduleLoader.jsx b/src/ScheduleLoader.jsx index 8737fea..46487da 100644 --- a/src/ScheduleLoader.jsx +++ b/src/ScheduleLoader.jsx @@ -1,4 +1,6 @@ import useConferences from './hooks/useConferences.js'; +import { useState } from 'react'; +import Schedule from './Schedule.jsx'; export default function ScheduleLoader() { const { @@ -7,15 +9,20 @@ export default function ScheduleLoader() { isLoading, } = useConferences(); + const [ conferenceId, setConferenceId ] = useState(); + return (<> {isLoading &&

Please wait...

} {error &&

Error: {error}

} {conferences && <> - setConferenceId(e.target.value)}> {conferences.map(conference => )} } + {conferenceId &&
+ +
} ); }