import React from 'react';
import { UnityFluentIcon } from '../../iconLibrary/UnityFluentIcon';
import { getIconFromName } from '../../tree/TreeUtilities';
import { getCreditCardMethodIcon } from './CreditCardUtils';
import { InputAdornment } from '../../../UI/utilityDisplay/InputAdornment';
/**
 * CreditCardAdornment component displays an icon at the start of an input field.
 * It shows a default payment card icon if no credit card number is provided.
 * If a valid credit card number is provided, it displays the corresponding credit card method icon.
 *
 * @param {Object} props - The props object.
 * @param {string} props.creditCardNumberInput - The credit card number input string.
 * @returns {JSX.Element} The InputAdornment component with the appropriate icon.
 */
export const CreditCardAdornment = ({ creditCardNumberInput }) => {
    const defaultAdornment = (React.createElement(InputAdornment, { position: "start" }, React.createElement(UnityFluentIcon, { size: 12, icon: getIconFromName('PaymentCardIcon') })));
    if (!creditCardNumberInput)
        return defaultAdornment;
    const iconPath = getCreditCardMethodIcon(creditCardNumberInput);
    if (!iconPath || iconPath === "unknown")
        return defaultAdornment;
    return (React.createElement(InputAdornment, { position: "start" }, React.createElement("img", { src: iconPath, alt: "credit-card", width: 21 })));
};
//# sourceMappingURL=CreditCardAdornment.js.map