Set up translation with i18next
This commit is contained in:
@@ -15,6 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import useClipboard from "react-use-clipboard";
|
||||
|
||||
import { ReactComponent as CheckIcon } from "../icons/Check.svg";
|
||||
@@ -36,6 +37,7 @@ export function CopyButton({
|
||||
copiedMessage,
|
||||
...rest
|
||||
}: Props) {
|
||||
const { t } = useTranslation();
|
||||
const [isCopied, setCopied] = useClipboard(value, { successDuration: 3000 });
|
||||
|
||||
return (
|
||||
@@ -49,7 +51,7 @@ export function CopyButton({
|
||||
>
|
||||
{isCopied ? (
|
||||
<>
|
||||
{variant !== "icon" && <span>{copiedMessage || "Copied!"}</span>}
|
||||
{variant !== "icon" && <span>{copiedMessage || t("Copied!")}</span>}
|
||||
<CheckIcon />
|
||||
</>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user