import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; import type { ReactNode } from 'react'; import React from 'react'; import type { ButtonProps } from '../button'; import Button from '../button'; import defaultLocale from '../locale/en_US'; import LocaleReceiver from '../locale/LocaleReceiver'; import type { TourStepProps } from './interface'; const panelRender = ( props: TourStepProps, current: number, type: TourStepProps['type'], indicatorsRender?: TourStepProps['indicatorsRender'], ): ReactNode => { const { prefixCls, total = 1, title, onClose, onPrev, onNext, onFinish, cover, description, nextButtonProps, prevButtonProps, type: stepType, arrow, className, } = props; const mergedType = typeof stepType !== 'undefined' ? stepType : type; const isLastStep = current === total - 1; const prevBtnClick = () => { onPrev?.(); if (typeof prevButtonProps?.onClick === 'function') { prevButtonProps?.onClick(); } }; const nextBtnClick = () => { if (isLastStep) { onFinish?.(); } else { onNext?.(); } if (typeof nextButtonProps?.onClick === 'function') { nextButtonProps?.onClick(); } }; let headerNode: ReactNode; if (title) { headerNode = (