Last active
December 2, 2024 10:57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import useRerenderTimeout from '../hooks/use-rerender-timeout'; | |
import Upcoming from '../components/upcoming'; | |
import Started from '../components/started'; | |
type MeetingProps = { | |
startsAt: Date; | |
}; | |
const Meeting = ({ startsAt }: MeetingProps) => { | |
const now = new Date(); | |
const isUpcoming = now.getTime() < startsAt.getTime(); | |
useRerenderTimeout({ date: startsAt.toISOString() }); | |
return isUpcoming ? <Upcoming /> : <Started />; | |
}; | |
export default Meeting; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment