chore: update i18n keys

This commit is contained in:
JimmFly
2023-01-09 12:07:17 +08:00
parent 090890a94d
commit 7f8a577bd2
5 changed files with 95 additions and 76 deletions
@@ -1,6 +1,7 @@
import { Button } from '@/ui/button';
import { FC, useRef, ChangeEvent, ReactElement } from 'react';
import { styled } from '@/styles';
import { useTranslation } from 'react-i18next';
interface Props {
uploadType?: string;
children?: ReactElement;
@@ -9,6 +10,7 @@ interface Props {
}
export const Upload: FC<Props> = props => {
const { fileChange, accept } = props;
const { t } = useTranslation();
const input_ref = useRef<HTMLInputElement>(null);
const _chooseFile = () => {
if (input_ref.current) {
@@ -28,7 +30,7 @@ export const Upload: FC<Props> = props => {
};
return (
<UploadStyle onClick={_chooseFile}>
{props.children ?? <Button>Upload</Button>}
{props.children ?? <Button>{t('Upload')}</Button>}
<input
ref={input_ref}
type="file"