feat: add image upload for health package

This commit is contained in:
Kailasdevdas
2026-05-18 11:55:55 +05:30
parent 852a25269a
commit 098fe12fd7
6 changed files with 73 additions and 28 deletions
@@ -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);