Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90283ed

Browse files
committed
Use Language
1 parent 369af6b commit 90283ed

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

site/src/components/FormFooter/FormFooter.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { makeStyles } from "@material-ui/core/styles"
33
import React from "react"
44
import { LoadingButton } from "../LoadingButton/LoadingButton"
55

6+
const Language = {
7+
cancelLabel: "Cancel",
8+
defaultSubmitLabel: "Submit",
9+
}
10+
611
export interface FormFooterProps {
712
onCancel: () => void
813
isLoading: boolean
@@ -22,12 +27,16 @@ const useStyles = makeStyles(() => ({
2227
},
2328
}))
2429

25-
export const FormFooter: React.FC<FormFooterProps> = ({ onCancel, isLoading, submitLabel = "Submit" }) => {
30+
export const FormFooter: React.FC<FormFooterProps> = ({
31+
onCancel,
32+
isLoading,
33+
submitLabel = Language.defaultSubmitLabel,
34+
}) => {
2635
const styles = useStyles()
2736
return (
2837
<div className={styles.footer}>
2938
<Button className={styles.button} onClick={onCancel} variant="outlined">
30-
Cancel
39+
{Language.cancelLabel}
3140
</Button>
3241
<LoadingButton loading={isLoading} className={styles.button} variant="contained" color="primary" type="submit">
3342
{submitLabel}

0 commit comments

Comments
 (0)