mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-04-01 19:03:19 +02:00
27 lines
898 B
TypeScript
27 lines
898 B
TypeScript
import { Button } from '@material-ui/core';
|
|
import React, { useState, useEffect } from 'react'
|
|
import { useIntl } from 'react-intl'
|
|
|
|
type SubmitButton = {
|
|
value: string;
|
|
disabled?: boolean;
|
|
}
|
|
const SubmitButton = (props: SubmitButton) => {
|
|
const [disabled, setDisabled] = useState(props.disabled ? true : false);
|
|
const intl = useIntl();
|
|
|
|
let valueTxt = props.value;
|
|
if (disabled) {
|
|
valueTxt = intl.formatMessage({ id: "common.wait", defaultMessage: "Please wait ..." });
|
|
}
|
|
const [value, setValue] = useState(valueTxt);
|
|
return (
|
|
<Button color="primary" size="medium" variant="contained" type="submit"
|
|
disableElevation={true} disabled={disabled}
|
|
style={{width: '330px', height: '53px', padding: '0px 20px', margin: '7px 0px',fontSize: '18px' }} >
|
|
{value}
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
export default SubmitButton; |