File tree Expand file tree Collapse file tree 5 files changed +12
-0
lines changed
Expand file tree Collapse file tree 5 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 11import { useQuery } from '@tanstack/react-query' ;
22import { useUploadFile } from 'better-upload/client' ;
3+ import { Upload } from 'lucide-react' ;
34import { useFormContext , useWatch } from 'react-hook-form' ;
45import { useTranslation } from 'react-i18next' ;
56import { toast } from 'sonner' ;
67
78import { orpc } from '@/lib/orpc/client' ;
89
10+ import { Button } from '@/components/ui/button' ;
11+
912import { BookCover } from '@/features/book/book-cover' ;
1013import { FormFieldsBook } from '@/features/book/schema' ;
1114
@@ -72,6 +75,11 @@ export const FormBookCover = () => {
7275 coverId : uploadedFile ?. objectKey ?? coverId ,
7376 } }
7477 />
78+
79+ < span className = "absolute top-1/2 left-1/2 z-10 flex origin-center -translate-1/2 cursor-pointer items-center gap-2 rounded bg-white px-2 py-1 text-black" >
80+ < Upload size = "16" />
81+ { t ( 'book:manager.uploadCover' ) }
82+ </ span >
7583 </ label >
7684 </ div >
7785 ) ;
Original file line number Diff line number Diff line change 5959 },
6060 "updateError" : " فشل في تحديث الكتاب"
6161 },
62+ "uploadCover" : " رفع الغلاف" ,
6263 "uploadErrors" : {
6364 "NOT_AUTHENTICATED" : " تحتاج إلى تسجيل الدخول لتتمكن من رفع غلاف جديد" ,
6465 "UNAUTHORIZED" : " غير مسموح لك بتغيير غلاف الكتاب" ,
Original file line number Diff line number Diff line change 5959 },
6060 "updateError" : " Failed to update a book"
6161 },
62+ "uploadCover" : " Upload Cover" ,
6263 "uploadErrors" : {
6364 "NOT_AUTHENTICATED" : " You need to be authenticated to be able to upload a new cover" ,
6465 "UNAUTHORIZED" : " You are not allowed to change book cover" ,
Original file line number Diff line number Diff line change 5959 },
6060 "updateError" : " Échec de la modification du livre"
6161 },
62+ "uploadCover" : " Modifier" ,
6263 "uploadErrors" : {
6364 "NOT_AUTHENTICATED" : " Vous devez être authentifié pour pouvoir télécharger une nouvelle couverture" ,
6465 "UNAUTHORIZED" : " Vous n'êtes pas autorisé à changer la couverture du livre" ,
Original file line number Diff line number Diff line change 5959 },
6060 "updateError" : " Imeshindikana kusasisha kitabu"
6161 },
62+ "uploadCover" : " Pakia Jalada" ,
6263 "uploadErrors" : {
6364 "NOT_AUTHENTICATED" : " Unahitaji kuwa umeingia ili uweze kupakia jalada jipya" ,
6465 "UNAUTHORIZED" : " Hauruhusiwi kubadilisha jalada la kitabu" ,
You can’t perform that action at this time.
0 commit comments