Add new translations and update existing ones
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useState } from "react"
|
||||
import { CheckIcon } from "lucide-react"
|
||||
import { useTranslation } from "react-i18next"
|
||||
type Props = {
|
||||
onClick?: () => void
|
||||
disabled?: boolean
|
||||
@@ -13,11 +14,12 @@ export const SaveButton = ({
|
||||
onClick,
|
||||
disabled,
|
||||
className,
|
||||
text = "Save",
|
||||
textOnSave = "Saved",
|
||||
text = "save",
|
||||
textOnSave = "saved",
|
||||
btnType = "button"
|
||||
}: Props) => {
|
||||
const [clickedSave, setClickedSave] = useState(false)
|
||||
const { t } = useTranslation("common")
|
||||
return (
|
||||
<button
|
||||
type={btnType}
|
||||
@@ -33,7 +35,7 @@ export const SaveButton = ({
|
||||
disabled={disabled}
|
||||
className={`inline-flex mt-4 items-center rounded-md border border-transparent bg-black px-2 py-2 text-sm font-medium leading-4 text-white shadow-sm dark:bg-white dark:text-gray-800 disabled:opacity-50 ${className}`}>
|
||||
{clickedSave ? <CheckIcon className="w-4 h-4 mr-2" /> : null}
|
||||
{clickedSave ? textOnSave : text}
|
||||
{clickedSave ? t(textOnSave) : t(text)}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user