import clsx from 'clsx'; import { useAppSelector } from '@akinon/next/redux/hooks'; import { useLocalization } from '@akinon/next/hooks'; import SelectedPaymentOptionView from '@akinon/next/components/selected-payment-option-view'; import { partAttrs } from '@akinon/pz-theme/src/utils/part-styles'; import type { RootState } from '@theme/redux/store'; import AccordionSection, { SectionStatus } from '../accordion-section'; import PaymentOptionsGrid from '../payment-options-grid'; import { PaymentGridSkeleton } from '../skeletons/payment-skeleton'; interface PaymentSectionProps { status: SectionStatus; onEdit: () => void; } const PaymentSection = ({ status, onEdit }: PaymentSectionProps) => { const { t } = useLocalization(); const isPaymentStepBusy = useAppSelector( (state: RootState) => state.checkout.steps.payment.busy ); const paymentOption = useAppSelector( (state: RootState) => state.checkout.preOrder?.payment_option ); const paymentOptionsCount = useAppSelector( (state: RootState) => state.checkout.paymentOptions.length ); return (
{paymentOptionsCount === 0 ? ( ) : ( )}
{paymentOption && (
)} {!paymentOption && paymentOptionsCount > 0 && (

{t('checkout.one_page.payment.select_method')}

)}
); }; export default PaymentSection;