add
This commit is contained in:
parent
1684a8a3eb
commit
00fcce7a43
|
@ -9,6 +9,7 @@ import type { UploadFile } from "antd";
|
|||
import { useTusUpload } from "@web/src/hooks/useTusUpload";
|
||||
import toast from "react-hot-toast";
|
||||
import { getCompressedImageUrl } from "@nice/utils";
|
||||
import { api } from "@nice/client";
|
||||
|
||||
export interface TusUploaderProps {
|
||||
value?: string[];
|
||||
|
@ -29,6 +30,16 @@ export const TusUploader = ({
|
|||
onChange,
|
||||
multiple = true,
|
||||
}: TusUploaderProps) => {
|
||||
const { data: files } = api.resource.findMany.useQuery({
|
||||
where: {
|
||||
fileId: { in: value },
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
fileId: true,
|
||||
title: true,
|
||||
},
|
||||
});
|
||||
const { handleFileUpload, uploadProgress } = useTusUpload();
|
||||
const [uploadingFiles, setUploadingFiles] = useState<UploadingFile[]>([]);
|
||||
const [completedFiles, setCompletedFiles] = useState<UploadingFile[]>(
|
||||
|
|
Loading…
Reference in New Issue