import React, { useState } from "react" import { NotificationEvent } from "../../../../hooks/use-build-timeline" import ArrowRightIcon from "../../../fundamentals/icons/arrow-right-icon" import MailIcon from "../../../fundamentals/icons/mail-icon" import SendIcon from "../../../fundamentals/icons/send-icon" import EventActionables from "../event-actionables" import EventContainer from "../event-container" import ResendModal from "./resend-modal" type NotificationProps = { event: NotificationEvent } const notificationTitleMap = { "order.items_returned": "Return Received Notice Sent", "order.return_requested": "Return Request Confirmation Sent", "order.placed": "Order Confirmation Sent", "order.shipment_created": "Shipment Confirmation Sent", } const Notification: React.FC = ({ event }) => { const [showResend, setShowResend] = useState(false) const actions = ( , onClick: () => setShowResend(true), }, ]} /> ) return ( <> } title={notificationTitleMap[event.title] || event.title} time={event.time} topNode={actions} midNode={} /> {showResend && ( setShowResend(false)} notificationId={event.id} email={event.to} /> )} ) } const ReceiverNode: React.FC<{ email: string }> = ({ email }) => { return (
{email}
) } export default Notification