blob: 0727eb8899a3baa79fc1910c1f066a22549db8f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
import React from "react";
import { useTranslation } from "react-i18next";
import { convertI18nText, I18nText } from "@/common";
import { PaletteColorType } from "@/palette";
import "./FlatButton.css";
import classNames from "classnames";
function _FlatButton(
{
text,
color,
onClick,
}: {
text: I18nText;
color?: PaletteColorType;
onClick?: () => void;
},
ref: React.ForwardedRef<HTMLButtonElement>
): React.ReactElement | null {
const { t } = useTranslation();
return (
<button
ref={ref}
className={classNames("cru-flat-button", color ?? "primary")}
onClick={onClick}
>
{convertI18nText(text, t)}
</button>
);
}
const FlatButton = React.forwardRef(_FlatButton);
export default FlatButton;
|