import type { RefObject } from 'react'; import { AnimatePresence, motion } from 'motion/react'; import { ChevronLeft, ChevronRight, Sparkles, X } from 'lucide-react'; import FeedbackFormStep from './FeedbackFormStep'; import FeedbackSuccessStep from './FeedbackSuccessStep'; import FeedbackTypeStep from './FeedbackTypeStep'; import type { FeedbackStep, FeedbackType, UploadedImg } from './types'; interface Props { canNext: boolean; content: string; error: string | null; fileRef: RefObject; maxScreenshots: number; module: string; open: boolean; progress: number; screenshots: UploadedImg[]; step: FeedbackStep; submitting: boolean; textareaRef: RefObject; type: FeedbackType | null; uploading: boolean; onAddFiles: (files: FileList | File[]) => void | Promise; onBack: () => void; onChangeContent: (content: string) => void; onChangeModule: (module: string) => void; onClose: () => void; onNext: () => void; onRemoveScreenshot: (index: number) => void; onSelectType: (type: FeedbackType) => void; } export default function FeedbackModal({ canNext, content, error, fileRef, maxScreenshots, module, open, progress, screenshots, step, submitting, textareaRef, type, uploading, onAddFiles, onBack, onChangeContent, onChangeModule, onClose, onNext, onRemoveScreenshot, onSelectType, }: Props) { return ( {open && ( e.stopPropagation()} >
{step === 3 ? '收到啦~' : '提个建议'}
{step === 1 && '第一步 / 共 2 步'} {step === 2 && '第二步 / 共 2 步'} {step === 3 && '感谢你的反馈'}
{step === 1 && ( )} {step === 2 && ( )} {step === 3 && }
{step < 3 && (
{step > 1 && ( )}
)} {step === 3 && (
)} )} ); }