Skip to content

Instantly share code, notes, and snippets.

@aquinq
Last active December 2, 2024 10:57
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