mirror of
https://github.com/dyzulk/dyzulk.github.io.git
synced 2026-01-26 13:51:55 +07:00
feat: Add useUpload hook for handling file uploads to R2 storage via presigned URLs.
This commit is contained in:
@@ -9,7 +9,7 @@ export const useUpload = () => {
|
|||||||
const [uploading, setUploading] = useState(false);
|
const [uploading, setUploading] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
const uploadFile = async (file: File, folder: string = 'uploads'): Promise<UploadResult | null> => {
|
const uploadFile = async (file: File, folder: string = 'imagine/misc'): Promise<UploadResult | null> => {
|
||||||
setUploading(true);
|
setUploading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user