import React from 'react'; import { QueueStatus } from './helpers/Interfaces'; interface QueueStatusIndicatorProps { queueStatus: QueueStatus; } const QueueStatusIndicator: React.FC = ({ queueStatus }) => { if (!queueStatus.inQueue) return null; return (
{queueStatus.rank === 0 ? (

You're next in line! ({queueStatus.queueSize} total in queue)

) : (

Queue position: {queueStatus.rank! + 1} of {queueStatus.queueSize}

)} {queueStatus.rankEta && (

Estimated wait: {Math.ceil(queueStatus.rankEta)} seconds

)}
); }; export default QueueStatusIndicator;