- implement setup page with video feed and preview functionality

This commit is contained in:
2025-12-23 14:36:16 +00:00
parent 9394793669
commit 73c67ad992
7 changed files with 100 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
import { useQuery } from "@tanstack/react-query";
import { cambase } from "../../../app/config";
const fetchVideoPreview = async () => {
const response = await fetch(`${cambase}/Colour-preview`);
if (!response.ok) {
throw new Error("Failed to fetch video preview");
}
return response.blob();
};
export const useVideoPreview = () => {
const videoPreviewQuery = useQuery({
queryKey: ["videoPreview"],
queryFn: fetchVideoPreview,
refetchInterval: 100,
});
return { videoPreviewQuery };
};