feat: add image upload for health package
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import {useState, useRef} from "react";
|
||||
import {Button} from "@/components/ui/button";
|
||||
import {User, X, Loader2} from "lucide-react";
|
||||
import { useState, useRef } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { User, X, Loader2 } from "lucide-react";
|
||||
import axios from "axios";
|
||||
|
||||
interface BytescaleUploaderProps {
|
||||
value: string;
|
||||
onChange: (url: string) => void;
|
||||
folderPath: "/doctors" | "/departments" | "/news" | "/blog";
|
||||
folderPath:
|
||||
| "/doctors"
|
||||
| "/departments"
|
||||
| "/news"
|
||||
| "/blog"
|
||||
| "/health-packages";
|
||||
}
|
||||
|
||||
export function BytescaleUploader({
|
||||
@@ -40,7 +45,7 @@ export function BytescaleUploader({
|
||||
},
|
||||
});
|
||||
|
||||
const {fileUrl} = response.data;
|
||||
const { fileUrl } = response.data;
|
||||
onChange(fileUrl);
|
||||
} catch (e: any) {
|
||||
console.error("Upload Error:", e);
|
||||
|
||||
Reference in New Issue
Block a user