({ isOpen, onClose })
| 472 | }; |
| 473 | |
| 474 | const TutorialModal = ({ isOpen, onClose }) => { |
| 475 | const { |
| 476 | currentStep, |
| 477 | currentStepData, |
| 478 | highlightRect, |
| 479 | tooltipPosition, |
| 480 | animationState, |
| 481 | isFirstStep, |
| 482 | isLastStep, |
| 483 | totalSteps, |
| 484 | isCentered, |
| 485 | handleNext, |
| 486 | handlePrev, |
| 487 | handleSkip, |
| 488 | handleDotClick, |
| 489 | } = useTutorial(isOpen, onClose); |
| 490 | |
| 491 | if (!isOpen) return null; |
| 492 | |
| 493 | if (!currentStepData) { |
| 494 | console.error("TutorialModal: No step data available"); |
| 495 | return null; |
| 496 | } |
| 497 | |
| 498 | return ( |
| 499 | <div className="tutorial-modal-container" aria-hidden={!isOpen}> |
| 500 | <TutorialOverlay |
| 501 | highlightRect={highlightRect} |
| 502 | isTransitioning={animationState.isTransitioning} |
| 503 | /> |
| 504 | |
| 505 | <TutorialTooltip |
| 506 | step={currentStepData} |
| 507 | currentStep={currentStep} |
| 508 | totalSteps={totalSteps} |
| 509 | position={tooltipPosition} |
| 510 | animationState={animationState} |
| 511 | isFirstStep={isFirstStep} |
| 512 | isLastStep={isLastStep} |
| 513 | isCentered={isCentered} |
| 514 | onPrev={handlePrev} |
| 515 | onNext={handleNext} |
| 516 | onSkip={handleSkip} |
| 517 | onDotClick={handleDotClick} |
| 518 | onClose={onClose} |
| 519 | /> |
| 520 | </div> |
| 521 | ); |
| 522 | }; |
| 523 | |
| 524 | TutorialModal.propTypes = { |
| 525 | isOpen: PropTypes.bool.isRequired, |
nothing calls this directly
no test coverage detected