refactor: create cluster by steps
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user