import React from 'react'; import { useAppDispatch } from '@akinon/next/redux/hooks'; import { setCurrentStep } from '@akinon/next/redux/reducers/checkout'; import { partAttrs } from '@akinon/pz-theme/src/utils/part-styles'; import { Icon } from '@theme/components'; import clsx from 'clsx'; import { CheckoutStep } from '@akinon/next/types'; type Props = { label: string; tabKey?: CheckoutStep; selected?: boolean; completed?: boolean; disabled?: boolean; number: string; }; export const CheckoutStepButton = ({ label, number, tabKey, selected, completed, disabled }: Props) => { const dispatch = useAppDispatch(); const handleClick = () => { if (!tabKey || disabled) { return; } dispatch(setCurrentStep(tabKey)); }; return ( ); };