chore: model list ux
This commit is contained in:
@@ -5,6 +5,8 @@ type FormButtonsProps = {
|
||||
onCancel?: () => void;
|
||||
cancelText?: string;
|
||||
okText?: string;
|
||||
showOk?: boolean;
|
||||
showCancel?: boolean;
|
||||
htmlType?: 'submit' | 'button';
|
||||
};
|
||||
const FormButtons: React.FC<FormButtonsProps> = ({
|
||||
@@ -12,21 +14,27 @@ const FormButtons: React.FC<FormButtonsProps> = ({
|
||||
onCancel,
|
||||
cancelText,
|
||||
okText,
|
||||
showCancel = true,
|
||||
showOk = true,
|
||||
htmlType = 'button'
|
||||
}) => {
|
||||
return (
|
||||
<Space size={40} style={{ marginTop: '80px' }}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={onOk}
|
||||
style={{ width: '120px' }}
|
||||
htmlType={htmlType}
|
||||
>
|
||||
{okText || '保存'}
|
||||
</Button>
|
||||
<Button onClick={onCancel} style={{ width: '98px' }}>
|
||||
{cancelText || '取消'}
|
||||
</Button>
|
||||
{showOk && (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={onOk}
|
||||
style={{ width: '120px' }}
|
||||
htmlType={htmlType}
|
||||
>
|
||||
{okText || '保存'}
|
||||
</Button>
|
||||
)}
|
||||
{showCancel && (
|
||||
<Button onClick={onCancel} style={{ width: '98px' }}>
|
||||
{cancelText || '取消'}
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user