import React from 'react'; import { Modal, Button } from '@akinon/next/components'; import mpBlackLogo from '../assets/img/masterpass-black-logo.png'; import type { InformationModalType, InformationModalData } from '../types/payment.types'; export interface InformationModalProps { open: boolean; onClose: () => void; data: InformationModalData | null; onButtonClick?: () => void; } const iconMap: Record = { warning: ( ), error: ( ), success: ( ), info: ( ) }; const bgColorMap: Record = { warning: 'bg-amber-100', error: 'bg-red-100', success: 'bg-green-100', info: 'bg-blue-100' }; const InformationModal: React.FC = ({ open, onClose, data, onButtonClick }) => { const handleButtonClick = () => { if (onButtonClick) { onButtonClick(); } else { onClose(); } }; if (!data) return null; const { type, title, message, secondaryMessage, buttonText } = data; return ( } className="w-full sm:w-[28rem] max-h-[90vh] overflow-y-auto" >
{iconMap[type]}

{title}

{message}

{secondaryMessage && (

{secondaryMessage}

)}
); }; export default InformationModal;