InstaTube Downloader
import { useState } from "react";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
export default function ReelsDownloader() {
const [url, setUrl] = useState("");
const [videoUrl, setVideoUrl] = useState(null);
const [loading, setLoading] = useState(false);
const handleDownload = async () => {
if (!url) return;
setLoading(true);
try {
const response = await fetch("/api/download", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url }),
});
const data = await response.json();
setVideoUrl(data.videoUrl);
} catch (error) {
console.error("Error fetching video:", error);
}
setLoading(false);
};
return (
);
}
dytm ty
ReplyDelete