import Button from '@material-ui/core/Button'; import React, { useState } 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 ( ); } export default SubmitButton;