import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod" import { GenericCardIcon } from "./Icons/GenericCardIcon" import { SwishIcon } from "./Icons/SwishIcon" import { VippsIcon } from "./Icons/VippsIcon" import { MobilePayIcon } from "./Icons/MobilePayIcon" import { ApplePayIcon } from "./Icons/ApplePayIcon" import { GooglePayIcon } from "./Icons/GooglePayIcon" import { PayPalIcon } from "./Icons/PayPalIcon" import { KlarnaIcon } from "./Icons/KlarnaIcon" import { AmericanExpressIcon } from "./Icons/AmericanExpressIcon" import { DanKortIcon } from "./Icons/DanKortIcon" import { DinersClubIcon } from "./Icons/DinersClubIcon" import { JcbIcon } from "./Icons/JcbIcon" import { MasterCardIcon } from "./Icons/MasterCardIcon" import { VisaIcon } from "./Icons/VisaIcon" import { MaestroIcon } from "./Icons/MaestroIcon" import { ChinaUnionPayIcon } from "./Icons/ChinaUnionPayIcon" import { DiscoverIcon } from "./Icons/DiscoverIcon" import { PaymentIconProps } from "./Icons/IconProps" const paymentMethods: Partial< Record< keyof typeof PaymentMethodEnum, (props: PaymentIconProps) => React.ReactNode > > = { swish: (props) => , vipps: (props) => , mobilePay: (props) => , applePay: (props) => , googlePay: (props) => , payPal: (props) => , klarna: (props) => , americanExpress: (props) => , dankort: (props) => , dinersClub: (props) => , jcb: (props) => , masterCard: (props) => , visa: (props) => , maestro: (props) => , chinaUnionPay: (props) => , discover: (props) => , PartnerPoints: () => null, } type PaymentMethodIconProps = { paymentMethod: PaymentMethodEnum className?: string alt?: string } export const PaymentMethodIcon = ({ paymentMethod, ...props }: PaymentMethodIconProps) => { const Icon = paymentMethods[paymentMethod] if (!Icon) { return } return }