refactor: create cluster by steps

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 6e5a7035c8
commit 8de272239e
48 changed files with 1392 additions and 227 deletions
@@ -0,0 +1,63 @@
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button } from 'antd';
import styled from 'styled-components';
const Title = styled.span`
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 700;
font-size: 16px;
.text {
font-size: 20px;
}
`;
interface FooterButtonsProps {
onPrevious: () => void;
onNext: () => void;
handleCancel: () => void;
handleSubmit: () => void;
showButtons: Record<string, boolean>;
}
const FooterButtons: React.FC<FooterButtonsProps> = (props) => {
const { onPrevious, onNext, handleCancel, handleSubmit, showButtons } = props;
const intl = useIntl();
const handleOnNext = () => {
onNext();
};
return (
<Title style={{ height: 64 }}>
<div className="flex-center gap-16">
{showButtons.previous && (
<Button type="link" icon={<LeftOutlined />} onClick={onPrevious}>
Previous
</Button>
)}
{showButtons.next && (
<Button type="link" onClick={handleOnNext}>
Next
<RightOutlined />
</Button>
)}
{showButtons.skip && (
<Button type="primary" onClick={handleCancel}>
Skip for now
</Button>
)}
{showButtons.save && (
<Button
type="primary"
onClick={handleSubmit}
style={{ minWidth: 88 }}
>
{intl.formatMessage({ id: 'common.button.save' })}
</Button>
)}
</div>
</Title>
);
};
export default FooterButtons;