import React from 'react'; import StatusSentSvg from '../../../icons/status/sent.svg?react'; import StatusViewedDeliveredSvg from '../../../icons/status/viewed-delivered.svg?react'; import StatusErrorSvg from '../../../icons/status/error.svg?react'; import './TimeAndStatus.scss'; const statusIconDictionary = { sent: StatusSentSvg, delivered: StatusViewedDeliveredSvg, viewed: StatusViewedDeliveredSvg, error: StatusErrorSvg, }; interface TimeAndStatusProps { status?: 'sent' | 'delivered' | 'viewed' | 'error'; time: string; } export default function TimeAndStatus({ status, time }: TimeAndStatusProps) { const StatusIcon = statusIconDictionary[status!]; return (