2021-04-11 05:02:32 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Button, Spinner } from 'react-bootstrap';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
loading: boolean;
|
|
|
|
buttonText: string;
|
|
|
|
}
|
|
|
|
const SubmitButton = ({ loading, buttonText }: Props) => (
|
2021-04-11 10:07:57 +00:00
|
|
|
<Button
|
|
|
|
variant="success"
|
|
|
|
type="submit"
|
|
|
|
block
|
|
|
|
disabled={loading}
|
|
|
|
style={{ padding: '0', height: '40px' }}
|
|
|
|
>
|
2021-04-11 05:02:32 +00:00
|
|
|
{loading ? (
|
|
|
|
<Spinner
|
|
|
|
as="span"
|
|
|
|
style={{
|
2021-04-11 10:07:57 +00:00
|
|
|
height: '35px',
|
|
|
|
width: '35px',
|
2021-04-11 05:02:32 +00:00
|
|
|
}}
|
|
|
|
animation="border"
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
buttonText
|
|
|
|
)}
|
|
|
|
</Button>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default SubmitButton;
|