import React, { useState } from 'react'; import { Button, message, Steps } from 'antd'; const steps = [ { title: 'First', content: 'First-content', }, { title: 'Second', content: 'Second-content', }, { title: 'Last', content: 'Last-content', }, ]; const App: React.FC = () => { 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 })); return ( <>
{steps[current].content}
{current < steps.length - 1 && ( )} {current === steps.length - 1 && ( )} {current > 0 && ( )}
); }; export default App;