aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/common/button/LoadingButton.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'FrontEnd/src/views/common/button/LoadingButton.tsx')
-rw-r--r--FrontEnd/src/views/common/button/LoadingButton.tsx40
1 files changed, 0 insertions, 40 deletions
diff --git a/FrontEnd/src/views/common/button/LoadingButton.tsx b/FrontEnd/src/views/common/button/LoadingButton.tsx
deleted file mode 100644
index fceaec27..00000000
--- a/FrontEnd/src/views/common/button/LoadingButton.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import * as React from "react";
-import classNames from "classnames";
-import { useTranslation } from "react-i18next";
-
-import { convertI18nText, I18nText } from "@/common";
-import { PaletteColorType } from "@/palette";
-
-import Spinner from "../Spinner";
-
-interface LoadingButtonProps extends React.ComponentPropsWithoutRef<"button"> {
- color?: PaletteColorType;
- text?: I18nText;
- loading?: boolean;
-}
-
-function LoadingButton(props: LoadingButtonProps): JSX.Element {
- const { t } = useTranslation();
-
- const { color, text, loading, className, children, ...otherProps } = props;
-
- if (text != null && children != null) {
- console.warn("You can't set both text and children props.");
- }
-
- return (
- <button
- className={classNames(
- "cru-" + (color ?? "primary"),
- "cru-button outline",
- className,
- )}
- {...otherProps}
- >
- {text != null ? convertI18nText(text, t) : children}
- {loading && <Spinner />}
- </button>
- );
-}
-
-export default LoadingButton;