import React, { useState } from 'react'; import { Button, message, Steps, theme } from 'antd'; const steps = [ { title: 'First', content: 'First-content', }, { title: 'Second', content: 'Second-content', }, { title: 'Last', content: 'Last-content', }, ]; const App: React.FC = () => { const { token } = theme.useToken(); const [current, setCurrent] = useState(0); const next = () => { setCurrent(current + 1); }; const prev = () => { setCurrent(current - 1); }; const items = steps.map((item) => ({ key: item.title, title: item.title })); const contentStyle: React.CSSProperties = { lineHeight: '260px', textAlign: 'center', color: token.colorTextTertiary, backgroundColor: token.colorFillAlter, borderRadius: token.borderRadiusLG, border: `1px dashed ${token.colorBorder}`, marginTop: 16, }; return ( <>
{steps[current].content}
{current < steps.length - 1 && ( )} {current === steps.length - 1 && ( )} {current > 0 && ( )}
); }; export default App;