import { PlatformActionButton } from '../common/PlatformActionButton'; import { PlatformStatusMessage } from '../common/PlatformStatusMessage'; import { PlatformTextField } from '../common/PlatformTextField'; import { PlatformProfileModalShell } from './PlatformProfileModalShell'; export type PlatformProfileRewardCodeRedeemModalProps = { value: string; isSubmitting: boolean; error: string | null; success: string | null; onChange: (value: string) => void; onSubmit: () => void; onClose: () => void; }; /** * 个人中心兑换码弹窗。 * 保持原有输入、回车提交、禁用态和反馈消息语义不变。 */ export function PlatformProfileRewardCodeRedeemModal({ value, isSubmitting, error, success, onChange, onSubmit, onClose, }: PlatformProfileRewardCodeRedeemModalProps) { return ( onChange(event.target.value)} onKeyDown={(event) => { if (event.key === 'Enter') { onSubmit(); } }} size="sm" density="roomy" className="uppercase tracking-normal" placeholder="输入兑换码" aria-label="兑换码" autoFocus /> {isSubmitting ? '兑换中' : '兑换'} {error ? ( {error} ) : null} {success ? ( {success} ) : null} ); }