ente/src/components/SubmitButton.tsx

29 lines
654 B
TypeScript
Raw Normal View History

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"
animation="border"
2021-04-11 14:20:24 +00:00
style={{ width: '22px', height: '22px', borderWidth: '0.20em' }}
2021-04-11 05:02:32 +00:00
/>
) : (
buttonText
)}
</Button>
);
export default SubmitButton;