Add OSD and Payload configuration components with toggle functionality
This commit is contained in:
16
src/features/output/hooks/usePayloadConfig.ts
Normal file
16
src/features/output/hooks/usePayloadConfig.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
const fetchPayloadConfig = async () => {
|
||||
const response = await fetch("/api/payload-config");
|
||||
if (!response.ok) throw new Error("Failed to fetch payload config");
|
||||
return response.json();
|
||||
};
|
||||
|
||||
export const usePayloadCongfig = () => {
|
||||
const payloadConfigQuery = useQuery({
|
||||
queryKey: ["payloadConfig"],
|
||||
queryFn: fetchPayloadConfig,
|
||||
});
|
||||
|
||||
return { payloadConfigQuery };
|
||||
};
|
||||
Reference in New Issue
Block a user